]> Sergey Matveev's repositories - btrtrc.git/commitdiff
BytesInfoHash wasn't actually initializing the info hash
authorMatt Joiner <anacrolix@gmail.com>
Sun, 29 Sep 2013 06:43:35 +0000 (16:43 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 29 Sep 2013 06:43:35 +0000 (16:43 +1000)
client.go

index a787fd9ffd37e817beaddffa1783e2b5125b65f8..95dc790acd04735b9837221663409cba330b7183 100644 (file)
--- 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