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.
| 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. |
| 23 | inline 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 |
no outgoing calls
no test coverage detected