mirror of
https://github.com/nlohmann/json.git
synced 2025-07-25 13:41:56 +03:00
🚑 fixing fuzzers to work with new exceptions
This commit is contained in:
@ -44,23 +44,19 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
||||
// deserializations must match
|
||||
assert(j1 == j2);
|
||||
}
|
||||
catch (const std::invalid_argument&)
|
||||
catch (const json::parse_error&)
|
||||
{
|
||||
// parsing a MessagePack serialization must not fail
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
catch (const std::invalid_argument&)
|
||||
catch (const json::parse_error&)
|
||||
{
|
||||
// parse errors are ok, because input may be random bytes
|
||||
}
|
||||
catch (const std::out_of_range&)
|
||||
catch (const json::type_error&)
|
||||
{
|
||||
// parse errors are ok, because input may be random bytes
|
||||
}
|
||||
catch (const std::domain_error&)
|
||||
{
|
||||
// parse errors are ok, because input may be random bytes
|
||||
// type errors can occur during parsing, too
|
||||
}
|
||||
|
||||
// return 0 - non-zero return values are reserved for future use
|
||||
|
Reference in New Issue
Block a user