MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / ForceHeader

Function ForceHeader

apps/fuzzers/Fuzzer/fuzz_structure.hpp:23–31  ·  view source on GitHub ↗

Overwrite the first hdrLen bytes of the input with hdr, keep data[hdrLen..] as the fuzzable body. A shorter-than-header input becomes just the header.

Source from the content-addressed store, hash-verified

21// Overwrite the first hdrLen bytes of the input with hdr, keep data[hdrLen..] as the
22// fuzzable body. A shorter-than-header input becomes just the header.
23inline std::vector<uint8_t> ForceHeader(const uint8_t* hdr, size_t hdrLen, const uint8_t* data, size_t size)
24{
25 std::vector<uint8_t> out(hdr, hdr + hdrLen);
26 if (size > hdrLen)
27 {
28 out.insert(out.end(), data + hdrLen, data + size);
29 }
30 return out;
31}
32} // namespace fuzz

Callers 4

LLVMFuzzerTestOneInputFunction · 0.85
LLVMFuzzerTestOneInputFunction · 0.85
LLVMFuzzerTestOneInputFunction · 0.85
LLVMFuzzerTestOneInputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected