From f47aabd094a4eafeed5a510c650d7a063a148076 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Mon, 23 May 2016 17:32:24 +0100 Subject: Add support for building fuzzers using american fuzzy lop Builds fuzzers using http://lcamtuf.coredump.cx/afl/ --- fuzzers/fuzz_unpickle_session.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 fuzzers/fuzz_unpickle_session.cpp (limited to 'fuzzers/fuzz_unpickle_session.cpp') diff --git a/fuzzers/fuzz_unpickle_session.cpp b/fuzzers/fuzz_unpickle_session.cpp new file mode 100644 index 0000000..6edbc96 --- /dev/null +++ b/fuzzers/fuzz_unpickle_session.cpp @@ -0,0 +1,14 @@ +#include "olm/session.hh" +#include "fuzzing.hh" + +int main(int argc, const char *argv[]) { + int pickle_fd = STDIN_FILENO; + uint8_t * pickle_buffer; + ssize_t pickle_length = check_errno( + "Error reading pickle file", read_file(pickle_fd, &pickle_buffer) + ); + olm::Session * session = new olm::Session; + unpickle(pickle_buffer, pickle_buffer + pickle_length, *session); + free(pickle_buffer); + delete session; +} -- cgit v1.2.3