2016-02-12 09:35:08 +00:00
|
|
|
/*
|
|
|
|
__ _____ _____ _____
|
|
|
|
__| | __| | | | JSON for Modern C++ (fuzz test support)
|
2016-07-31 11:37:04 +00:00
|
|
|
| | |__ | | | | | | version 2.0.2
|
2016-02-12 09:35:08 +00:00
|
|
|
|_____|_____|_____|_|___| https://github.com/nlohmann/json
|
|
|
|
|
2016-02-14 17:38:29 +00:00
|
|
|
Run "make fuzz_testing" and follow the instructions.
|
2016-02-12 09:35:08 +00:00
|
|
|
|
|
|
|
Licensed under the MIT License <http://opensource.org/licenses/MIT>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <json.hpp>
|
|
|
|
|
|
|
|
using json = nlohmann::json;
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
#ifdef __AFL_HAVE_MANUAL_CONTROL
|
2016-02-14 17:38:29 +00:00
|
|
|
while (__AFL_LOOP(1000))
|
|
|
|
{
|
2016-02-12 09:35:08 +00:00
|
|
|
#endif
|
2016-02-14 17:38:29 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
json j(std::cin);
|
2016-02-14 20:36:56 +00:00
|
|
|
std::cout << j << std::endl;
|
2016-02-14 17:38:29 +00:00
|
|
|
}
|
2016-02-14 21:24:45 +00:00
|
|
|
catch (std::invalid_argument& e)
|
2016-02-14 17:38:29 +00:00
|
|
|
{
|
|
|
|
std::cout << "Invalid argument in parsing" << e.what() << '\n';
|
|
|
|
}
|
2016-02-12 09:35:08 +00:00
|
|
|
#ifdef __AFL_HAVE_MANUAL_CONTROL
|
2016-02-14 17:38:29 +00:00
|
|
|
}
|
2016-02-12 09:35:08 +00:00
|
|
|
#endif
|
|
|
|
}
|