2016-02-12 09:35:08 +00:00
|
|
|
/*
|
|
|
|
__ _____ _____ _____
|
|
|
|
__| | __| | | | JSON for Modern C++ (fuzz test support)
|
|
|
|
| | |__ | | | | | | version 2.0.0
|
|
|
|
|_____|_____|_____|_|___| 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
|
|
|
}
|
|
|
|
catch (std::invalid_argument &e)
|
|
|
|
{
|
|
|
|
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
|
|
|
|
}
|