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

Function LLVMFuzzerTestOneInput

apps/fuzzers/Fuzzer/fuzz_savegame.cpp:32–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
33{
34 // Force a valid "\0raP" magic + version 4 so mutations reach the entry tree
35 // instead of failing the magic / EBadVersion gate.
36 static const uint8_t HDR[] = {0x00, 0x72, 0x61, 0x50, 0x04, 0x00, 0x00, 0x00};
37 std::vector<uint8_t> buf = fuzz::ForceHeader(HDR, sizeof(HDR), data, size);
38 try
39 {
40 ParamFile pf;
41 QIStream in(reinterpret_cast<char*>(buf.data()), static_cast<int>(buf.size()));
42 SerializeBinStream f(&in);
43 pf.SerializeBin(f);
44 }
45 catch (...)
46 {
47 }
48 return 0;
49}

Callers

nothing calls this directly

Calls 3

ForceHeaderFunction · 0.85
sizeMethod · 0.80
SerializeBinMethod · 0.45

Tested by

no test coverage detected