mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-05-01 00:07:19 +02:00
Update libraries and make it build on windows.
Still gets some warnings because compilers have changed. But should work.
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
add_executable(JSON-parse-fuzzer JsonParse.cpp)
|
||||
target_link_libraries(JSON-parse-fuzzer PUBLIC Poco::JSON)
|
||||
set_target_properties(JSON-parse-fuzzer PROPERTIES LINK_FLAGS $ENV{LIB_FUZZING_ENGINE})
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
#include "Poco/JSON/Parser.h"
|
||||
|
||||
using namespace Poco;
|
||||
using namespace Poco::JSON;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
||||
{
|
||||
std::string json(reinterpret_cast<const char*>(data), size);
|
||||
Parser parser;
|
||||
Dynamic::Var result;
|
||||
|
||||
try
|
||||
{
|
||||
result = parser.parse(json);
|
||||
}
|
||||
catch (Exception& e)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user