21#if defined(SDDSPP_FUZZ_STANDALONE)
28extern "C" int LLVMFuzzerTestOneInput(
const std::uint8_t *data, std::size_t size) {
29 sdds::ReaderOptions options;
30 options.recovery = sdds::RecoveryMode::Strict;
31 options.compression = sdds::Compression::None;
32 options.limits.maxRows = 10000;
33 options.limits.maxElements = 100000;
34 options.limits.maxStringBytes = 65536;
35 options.limits.maxLayoutCommandBytes = 65536;
36 options.limits.maxDecompressedBytes = 1024U * 1024U;
37 options.limits.maxIncludeDepth = 0;
38 options.limits.maxPageIndexEntries = 1024;
40 auto reader = sdds::Reader::fromSource(sdds::inputFromMemory(data, size),
41 "fuzz-input", options);
42 sdds::ReadRequest request;
43 request.rows.stride = 3;
44 while (reader.next(request)) {}
46 }
catch (
const sdds::Error &) {
47 }
catch (
const std::exception &) {
52#if defined(SDDSPP_FUZZ_STANDALONE)
53int main(
int argc,
char **argv) {
54 for (
int argument = 1; argument < argc; ++argument) {
55 std::ifstream input(argv[argument], std::ios::binary);
56 const std::vector<std::uint8_t> bytes((std::istreambuf_iterator<char>(input)),
57 std::istreambuf_iterator<char>());
58 LLVMFuzzerTestOneInput(bytes.data(), bytes.size());