diff --git a/codec.go b/codec.go index e05bbb8..5193d5b 100644 --- a/codec.go +++ b/codec.go @@ -70,9 +70,10 @@ func validateBytes(b []byte) (err error) { return err } - if len(b) < size { + if len(b) < size || size < 0 { return fmt.Errorf("invalid value for size") } + b = b[size:] }