1
0
Fork 1
mirror of https://github.com/vbatts/tar-split.git synced 2025-07-05 07:48:29 +00:00

tar/storage: test out go-fuzz

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2017-04-11 09:08:48 -04:00
parent b9127a1393
commit 4de2011f4a
Signed by: vbatts
GPG key ID: 10937E57733F1362

23
tar/storage/fuzz.go Normal file
View file

@ -0,0 +1,23 @@
// +build gofuzz
package storage
import (
"bytes"
"log"
)
func Fuzz(data []byte) int {
unpacker := NewJSONUnpacker(bytes.NewReader(data))
for {
entry, err := unpacker.Next()
if err != nil {
log.Println(err)
return 0
}
log.Printf("%v", entry)
}
return 1
}