mirror of https://github.com/vbatts/tar-split.git
tar/storage: test out go-fuzz
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
b9127a1393
commit
4de2011f4a
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue