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

Function findStructuralBytes

json_fuzz_test.go:554–565  ·  view source on GitHub ↗

findStructuralBytes returns the positions of all bytes in data that match any of targets. Returns nil if none are found.

(data []byte, targets ...byte)

Source from the content-addressed store, hash-verified

552// findStructuralBytes returns the positions of all bytes in data that match
553// any of targets. Returns nil if none are found.
554func findStructuralBytes(data []byte, targets ...byte) []int {
555 var pos []int
556 for i, b := range data {
557 for _, t := range targets {
558 if b == t {
559 pos = append(pos, i)
560 break
561 }
562 }
563 }
564 return pos
565}
566
567// truncateAtValueBoundary cuts the document right after a ':' (before the
568// value starts). This is the OSS-Fuzz 4649128545288192 /

Callers 4

truncateAtValueBoundaryFunction · 0.85
truncateMidStructureFunction · 0.85
byteflipAtStructuralByteFunction · 0.85
injectMismatchedCloserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected