BytesInfoHash wasn't actually initializing the info hash

This commit is contained in:
Matt Joiner 2013-09-29 16:43:35 +10:00
parent 978aa1f0c8
commit fe80bf2f2f
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ func copyHashSum(dst, src []byte) {
} }
func BytesInfoHash(b []byte) (ih InfoHash) { func BytesInfoHash(b []byte) (ih InfoHash) {
if len(b) != len(ih) { if len(b) != len(ih) || copy(ih[:], b) != len(ih) {
panic("bad infohash bytes") panic("bad infohash bytes")
} }
return return