Created
December 5, 2018 06:05
-
-
Save fuzz-ai/546ad1410b4461bdd3dee5d3c60723fd to your computer and use it in GitHub Desktop.
fc::json::from_file test harness for AFL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <fc/variant.hpp> | |
| #include <fc/io/json.hpp> | |
| #include <fc/filesystem.hpp> | |
| #include <fc/exception/exception.hpp> | |
| #include <iostream> | |
| using fc::path; | |
| using fc::json; | |
| using fc::variant; | |
| int main( int argc, char *argv[] ) { | |
| if ( argc < 2 ) { | |
| return 1; | |
| } | |
| path inputFile( argv[1] ); | |
| try { | |
| variant v = json::from_file( inputFile ); | |
| } catch ( fc::exception &e ) { | |
| std::cout << e.to_string() << "\n"; | |
| return 1; | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment