Add vanilla parity harness and harden server boundaries

This commit is contained in:
Daniar Mannanov 2026-08-10 22:52:44 +03:00
parent 1924cb5591
commit ca019756ec
25 changed files with 1118 additions and 217 deletions

View 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)
})
}