Add vanilla parity harness and harden server boundaries
This commit is contained in:
parent
1924cb5591
commit
ca019756ec
25 changed files with 1118 additions and 217 deletions
16
internal/protocol/fuzz_test.go
Normal file
16
internal/protocol/fuzz_test.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package protocol
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func FuzzReadPacketNeverPanics(f *testing.F) {
|
||||
f.Add(AppendPacket(nil, -1, 0, nil))
|
||||
f.Add(AppendPacket(nil, 1, 42, []byte("payload")))
|
||||
f.Fuzz(func(t *testing.T, input []byte) {
|
||||
_, _ = ReadPacket(bufio.NewReader(bytes.NewReader(input)), 256)
|
||||
_, _ = ReadPacket(bufio.NewReader(bytes.NewReader(input)), -1)
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue