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

Function LLVMFuzzerTestOneInput

Tests/Fuzzing/xml_parser_fuzzer.cc:10–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "cmXMLParser.h"
9
10extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
11{
12 char test_file[] = "libfuzzer.xml";
13
14 FILE* fp = fopen(test_file, "wb");
15 if (!fp)
16 return 0;
17 fwrite(data, size, 1, fp);
18 fclose(fp);
19
20 cmXMLParser parser;
21 if (!parser.ParseFile(test_file)) {
22 return 1;
23 }
24
25 remove(test_file);
26 return 0;
27}

Callers

nothing calls this directly

Calls 1

ParseFileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…