Skip to content

Commit 5573706

Browse files
committed
Add fuzz test of packet reader
1 parent fea64f7 commit 5573706

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

openpgp/packet/fuzz_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//go:build go1.18
2+
// +build go1.18
3+
4+
package packet
5+
6+
import (
7+
"bytes"
8+
"testing"
9+
)
10+
11+
func FuzzPackets(f *testing.F) {
12+
f.Add([]byte("\x980\x040000\x16\t+\x06\x01\x04\x01\xdaG\x0f\x01\x00\x00"))
13+
f.Fuzz(func(t *testing.T, data []byte) {
14+
_, _ = Read(bytes.NewReader(data))
15+
})
16+
}

0 commit comments

Comments
 (0)