MCPcopy Create free account
hub / github.com/Kitware/CMake / LLVMFuzzerTestOneInput

Function LLVMFuzzerTestOneInput

Tests/Fuzzing/cmExprParserFuzzer.cxx:27–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25static constexpr size_t kMaxInputSize = 4096;
26
27extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
28{
29 if (size == 0 || size > kMaxInputSize) {
30 return 0;
31 }
32
33 // Create null-terminated string
34 std::string input(reinterpret_cast<char const*>(data), size);
35
36 cmExprParserHelper helper;
37
38 // Parse with different verbosity levels
39 int result = helper.ParseString(input.c_str(), 0);
40 (void)result;
41
42 // Always check result and error accessors
43 (void)helper.GetResult();
44 (void)helper.GetError();
45 (void)helper.GetWarning();
46
47 return 0;
48}

Callers

nothing calls this directly

Calls 4

c_strMethod · 0.80
ParseStringMethod · 0.45
GetResultMethod · 0.45
GetErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…