Fixed the <000000000 bug by adding if statement

This commit is contained in:
Ashley Svetlik 2019-06-14 10:06:37 -05:00
parent 0a87d8108f
commit 622fba4f27

View file

@ -3963,6 +3963,9 @@ func (op *op) UnmarshalBinary(data []byte) error {
_, _ = h.Write(data[0:9])
if op.typ > 1 {
if 1152921504606847000 < int(op.value) {
return fmt.Errorf("too big")
}
if len(data) < int(13+op.value*8) {
return fmt.Errorf("op data truncated - expected %d, got %d", 13+op.value*8, len(data))
}