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

Function LLVMFuzzerTestOneInput

apps/fuzzers/Fuzzer/fuzz_sqf_exec.cpp:42–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
43{
44 if (size > (8u << 10)) // execution amplifies; keep inputs small
45 return 0;
46 std::string src(reinterpret_cast<const char*>(data), size);
47 GameVarSpace local(GGameState.GetContext());
48 GGameState.BeginContext(&local);
49 try
50 {
51 GGameState.EvaluateMultiple(src.c_str(), true);
52 }
53 catch (...)
54 {
55 }
56 GGameState.EndContext(); // always pop, even on a thrown error, so the stack stays sane
57 return 0;
58}

Callers

nothing calls this directly

Calls 4

BeginContextMethod · 0.80
EvaluateMultipleMethod · 0.80
EndContextMethod · 0.80
GetContextMethod · 0.45

Tested by

no test coverage detected