From fe80bf2f2f3b2547005174ee8416eec1100b47eb Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sun, 29 Sep 2013 16:43:35 +1000 Subject: [PATCH] BytesInfoHash wasn't actually initializing the info hash --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index a787fd9f..95dc790a 100644 --- a/client.go +++ b/client.go @@ -29,7 +29,7 @@ func copyHashSum(dst, src []byte) { } 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") } return -- 2.48.1