MCPcopy
hub / github.com/jackc/pgx / FuzzFunctionCallResponse

Function FuzzFunctionCallResponse

pgproto3/fuzz_test.go:147–156  ·  view source on GitHub ↗
(f *testing.F)

Source from the content-addressed store, hash-verified

145}
146
147func FuzzFunctionCallResponse(f *testing.F) {
148 f.Add([]byte{0, 0, 0, 3, 'a', 'b', 'c'})
149 f.Add([]byte{0xFF, 0xFF, 0xFF, 0xFF}) // NULL
150 f.Add([]byte{0xFF, 0xFF, 0xFF, 0xFE}) // negative length
151 f.Add([]byte{})
152 f.Fuzz(func(t *testing.T, data []byte) {
153 var msg pgproto3.FunctionCallResponse
154 msg.Decode(data) // must not panic
155 })
156}
157
158func FuzzParse(f *testing.F) {
159 f.Add([]byte{0, 0, 0, 0})

Callers

nothing calls this directly

Calls 1

DecodeMethod · 0.95

Tested by

no test coverage detected