Files
simdjson-simdjson/fuzz/fuzz_minify.cpp
T
Paul Dreik 30b912fc81 fuzz at_pointer
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
2020-09-16 21:17:43 +02:00

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;
}