Commit 9e13209d authored by Jeromy's avatar Jeromy

fix underflow error found by fuzzing

parent 256afede
...@@ -70,9 +70,10 @@ func validateBytes(b []byte) (err error) { ...@@ -70,9 +70,10 @@ func validateBytes(b []byte) (err error) {
return err return err
} }
if len(b) < size { if len(b) < size || size < 0 {
return fmt.Errorf("invalid value for size") return fmt.Errorf("invalid value for size")
} }
b = b[size:] b = b[size:]
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment