Limit decoded bencode string lengths to 32 bits

Found in fuzzing
This commit is contained in:
Matt Joiner 2021-09-29 16:56:01 +10:00
parent fcf65ee56a
commit 6156aebf71
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ func (d *Decoder) parseString(v reflect.Value) error {
// read the string length first
d.readUntil(':')
length, err := strconv.ParseInt(bytesAsString(d.buf.Bytes()), 10, 0)
length, err := strconv.ParseInt(bytesAsString(d.buf.Bytes()), 10, 32)
checkForIntParseError(err, start)
defer d.buf.Reset()