From d032aefd17bd075410c3f647cb7f1e73b469fd4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Fri, 17 Jun 2022 18:22:47 +0200 Subject: [PATCH] Add memory poisoning via mem allocation to 'afl_mysql_query_digest' --- test/afl_digest_test/afl_mysql_query_digest.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/afl_digest_test/afl_mysql_query_digest.cpp b/test/afl_digest_test/afl_mysql_query_digest.cpp index c6057831e..fde3355ca 100644 --- a/test/afl_digest_test/afl_mysql_query_digest.cpp +++ b/test/afl_digest_test/afl_mysql_query_digest.cpp @@ -184,7 +184,11 @@ int main(int argc, const char** argv) { while (__AFL_LOOP(10000)) { int len = __AFL_FUZZ_TESTCASE_LEN; - process_digest_test(buf, len); + + unsigned char* alloc_buff = static_cast(malloc(len)); + memcpy(alloc_buff, buf, len); + + process_digest_test(alloc_buff, len); } return 0;