Found immediately by fuzz test.
--- /dev/null
+#!/bin/sh -e
+
+dst=testdata/fuzz/FuzzItemDecode
+mkdir -p $dst
+# go install golang.org/x/tools/cmd/file2fuzz@latest
+file2fuzz -o $dst fuzz-input
}
var bin *Item
var binOff int
+ if len(buf) < 2 {
+ err = ErrNotEnough
+ return
+ }
if buf[1]&AtomStrings == 0 {
err = errors.New("wrong int value")
return
--- /dev/null
+package gyac
+
+import (
+ "testing"
+)
+
+func FuzzItemDecode(f *testing.F) {
+ f.Fuzz(func(t *testing.T, b []byte) {
+ ItemDecode(b)
+ })
+}