mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
30b912fc81
This adds a fuzzer for at_pointer() which recently had a bug. The #1142 bug had been found with this fuzzer Also, it polishes the github action job: cross pollinate the fuzzer corpora (lets fuzzers reuse results from other fuzzers) use github action syntax instead of bash checks only run on push if on master
21 lines
500 B
C++
21 lines
500 B
C++
#include "simdjson.h"
|
|
#include "FuzzUtils.h"
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <string>
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|
|
|
auto begin = as_chars(Data);
|
|
auto end = begin + Size;
|
|
|
|
std::string str(begin, end);
|
|
simdjson::dom::parser parser;
|
|
simdjson::dom::element elem;
|
|
auto error = parser.parse(str).get(elem);
|
|
if (error) { return 0; }
|
|
|
|
std::string minified=simdjson::minify(elem);
|
|
(void)minified;
|
|
return 0;
|
|
}
|