mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-11-21 19:27:09 +01: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:
1 parent
520a5eacc5
commit
f2b7499f85
3038 files changed
+251668
-273857
No files matched your search
@@ -0,0 +1,7 @@
|
||||
add_executable(Foundation-datetime-fuzzer DateTimeParse.cpp)
|
||||
target_link_libraries(Foundation-datetime-fuzzer PUBLIC Poco::Foundation)
|
||||
set_target_properties(Foundation-datetime-fuzzer PROPERTIES LINK_FLAGS $ENV{LIB_FUZZING_ENGINE})
|
||||
|
||||
add_executable(Foundation-misc-fuzzer MiscFuzzing.cpp)
|
||||
target_link_libraries(Foundation-misc-fuzzer PUBLIC Poco::Foundation)
|
||||
set_target_properties(Foundation-misc-fuzzer PROPERTIES LINK_FLAGS $ENV{LIB_FUZZING_ENGINE})
|
||||
@@ -0,0 +1,46 @@
|
||||
#include "Poco/DateTimeParser.h"
|
||||
#include "Poco/DateTimeFormat.h"
|
||||
#include "Poco/DateTimeFormatter.h"
|
||||
|
||||
using namespace Poco;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
||||
{
|
||||
const std::string input(reinterpret_cast<const char*>(data), size);
|
||||
|
||||
const std::string formats[] = {
|
||||
DateTimeFormat::ISO8601_FORMAT,
|
||||
DateTimeFormat::ISO8601_FRAC_FORMAT,
|
||||
DateTimeFormat::RFC822_FORMAT,
|
||||
DateTimeFormat::RFC1123_FORMAT,
|
||||
DateTimeFormat::HTTP_FORMAT,
|
||||
DateTimeFormat::RFC850_FORMAT,
|
||||
DateTimeFormat::RFC1036_FORMAT,
|
||||
DateTimeFormat::ASCTIME_FORMAT,
|
||||
DateTimeFormat::SORTABLE_FORMAT,
|
||||
"%m/%d/%y %h:%M %a",
|
||||
"T%H:%M:%F",
|
||||
};
|
||||
|
||||
int tzd = 0;
|
||||
DateTime dt;
|
||||
|
||||
for (const auto& format : formats)
|
||||
{
|
||||
DateTimeParser::tryParse(format, input, dt, tzd);
|
||||
DateTimeFormatter::format(dt.timestamp(), format, tzd);
|
||||
}
|
||||
|
||||
dt.makeLocal(tzd);
|
||||
dt.makeUTC(tzd);
|
||||
|
||||
try
|
||||
{
|
||||
dt = DateTimeParser::parse(input, tzd);
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
#include "Poco/URI.h"
|
||||
#include "Poco/Path.h"
|
||||
#include "Poco/UUID.h"
|
||||
#include "Poco/UTF8String.h"
|
||||
#include <fuzzer/FuzzedDataProvider.h>
|
||||
|
||||
using namespace Poco;
|
||||
|
||||
static void fuzzURI(FuzzedDataProvider& dataProvider)
|
||||
{
|
||||
try
|
||||
{
|
||||
URI uri1(dataProvider.ConsumeRandomLengthString());
|
||||
URI uri2(uri1, dataProvider.ConsumeRandomLengthString());
|
||||
|
||||
URI uri3(uri2);
|
||||
uri3.normalize();
|
||||
uri3.setQueryParameters(uri1.getQueryParameters());
|
||||
uri2 = uri3.toString();
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
static void fuzzPath(FuzzedDataProvider& dataProvider)
|
||||
{
|
||||
try
|
||||
{
|
||||
Path path1;
|
||||
path1.tryParse(dataProvider.ConsumeRandomLengthString());
|
||||
|
||||
Path path2(path1, Path(dataProvider.ConsumeRandomLengthString()));
|
||||
Path path3 = path1.absolute();
|
||||
Path path4 = Path::expand(dataProvider.ConsumeRandomLengthString());
|
||||
|
||||
const auto style1 = dataProvider.ConsumeIntegralInRange<char>(Path::PATH_UNIX, Path::PATH_GUESS);
|
||||
const auto style2 = dataProvider.ConsumeIntegralInRange<char>(Path::PATH_UNIX, Path::PATH_GUESS);
|
||||
path3.assign(path4.toString(static_cast<Path::Style>(style1)), static_cast<Path::Style>(style2));
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
static void fuzzUUID(FuzzedDataProvider& dataProvider)
|
||||
{
|
||||
try
|
||||
{
|
||||
UUID uuid1(dataProvider.ConsumeRandomLengthString());
|
||||
UUID uuid2(uuid1.toString());
|
||||
uuid2.tryParse(dataProvider.ConsumeRandomLengthString());
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
static void fuzzUTF8String(FuzzedDataProvider& dataProvider)
|
||||
{
|
||||
try
|
||||
{
|
||||
auto str1 = UTF8::unescape(dataProvider.ConsumeRandomLengthString());
|
||||
auto str2 = UTF8::escape(str1);
|
||||
|
||||
UTF8::toUpperInPlace(str1);
|
||||
UTF8::toLowerInPlace(str2);
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
||||
{
|
||||
FuzzedDataProvider dataProvider(data, size);
|
||||
|
||||
switch (dataProvider.ConsumeIntegral<char>())
|
||||
{
|
||||
case 0:
|
||||
fuzzURI(dataProvider);
|
||||
break;
|
||||
case 1:
|
||||
fuzzPath(dataProvider);
|
||||
break;
|
||||
case 2:
|
||||
fuzzUUID(dataProvider);
|
||||
break;
|
||||
case 3:
|
||||
fuzzUTF8String(dataProvider);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user