diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-03-13 00:18:30 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-03-13 00:18:30 -0700 |
commit | 15fba1debca5498989048677ffda38758b2df984 (patch) | |
tree | d2891e531717681619f55e79fc5efa81b46822e2 /tests/fuzz_parse.cpp | |
parent | 0542b1869b6970003caa954ebc5f1dea41d48032 (diff) |
tests: Add support for afl-fuzz
With the current setup it successfully finds the (fixed) DOCTYPE buffer overrun
in ~50 minutes (on a single core).
Diffstat (limited to 'tests/fuzz_parse.cpp')
-rw-r--r-- | tests/fuzz_parse.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/fuzz_parse.cpp b/tests/fuzz_parse.cpp new file mode 100644 index 0000000..e758196 --- /dev/null +++ b/tests/fuzz_parse.cpp @@ -0,0 +1,16 @@ +#include "../src/pugixml.hpp" +#include "allocator.hpp" + +int main(int argc, const char** argv) +{ + pugi::set_memory_management_functions(memory_allocate, memory_deallocate); + + pugi::xml_document doc; + + for (int i = 1; i < argc; ++i) + { + doc.load_file(argv[i]); + doc.load_file(argv[i], pugi::parse_minimal); + doc.load_file(argv[i], pugi::parse_full); + } +} |