]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix parsing of strings that don't fit in memory
authorMatt Joiner <anacrolix@gmail.com>
Wed, 29 Sep 2021 02:11:58 +0000 (12:11 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 29 Sep 2021 02:11:58 +0000 (12:11 +1000)
bencode/decode.go

index 57d2d0cc67db69fe66851954b945d34f1929238a..0cb04b91554e03561f8df4bacd5eb6df8ba96bfe 100644 (file)
@@ -614,7 +614,7 @@ func (d *Decoder) parseIntInterface() (ret interface{}) {
 func (d *Decoder) parseStringInterface() string {
        // read the string length first
        d.readUntil(':')
-       length, err := strconv.ParseInt(bytesAsString(d.buf.Bytes()), 10, 64)
+       length, err := strconv.ParseInt(bytesAsString(d.buf.Bytes()), 10, 32)
        if err != nil {
                panic(&SyntaxError{Offset: d.Offset - 1, What: err})
        }