mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 17:58:09 +08:00
Add fuzzing by way of ClusterFuzzLite
Signed-off-by: David Korczynski <david@adalogics.com>
This commit is contained in:
16
.clusterfuzzlite/parse_fuzzer.cpp
Normal file
16
.clusterfuzzlite/parse_fuzzer.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
#include <toml.hpp>
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
std::string s(reinterpret_cast<const char *>(data), size);
|
||||
std::istringstream iss(s);
|
||||
try {
|
||||
const auto ref = toml::parse(iss);
|
||||
} catch (...) {
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user