MCPcopy Create free account
hub / github.com/buger/jsonparser / applyMutation

Function applyMutation

json_fuzz_test.go:544–550  ·  view source on GitHub ↗

applyMutation picks one operator at random and applies it.

(r *rand.Rand, data []byte)

Source from the content-addressed store, hash-verified

542
543// applyMutation picks one operator at random and applies it.
544func applyMutation(r *rand.Rand, data []byte) []byte {
545 if len(data) < 2 {
546 return data
547 }
548 op := mutationOps[r.Intn(len(mutationOps))]
549 return op(r, data)
550}
551
552// findStructuralBytes returns the positions of all bytes in data that match
553// any of targets. Returns nil if none are found.

Callers 4

FuzzJSONStructureAwareFunction · 0.85
TestJSONFuzzCorpusSanityFunction · 0.85
FuzzEncodingJSONFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected