From b595727f2fe42dcd2e85a733fd2f2c321920b0d2 Mon Sep 17 00:00:00 2001 From: Tobias Scharnowski Date: Fri, 10 Jun 2022 18:38:37 +0200 Subject: [PATCH] Fix Byte Decrement Havoc Mutation While looking at the source code of the havoc mutations I realized that there seems to be a typo / copy+paste error with the SUBBYTE_ mutation. It is currently incrementing, instead of decrementing the value. Alternative Fix: Change the documentation to "/* Decrease byte by minus 1. */" to make it work as documented :-P --- src/afl-fuzz-one.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/afl-fuzz-one.c b/src/afl-fuzz-one.c index 19f41ebe..ef80524f 100644 --- a/src/afl-fuzz-one.c +++ b/src/afl-fuzz-one.c @@ -2585,7 +2585,7 @@ havoc_stage: snprintf(afl->m_tmp, sizeof(afl->m_tmp), " SUBBYTE_"); strcat(afl->mutation, afl->m_tmp); #endif - out_buf[rand_below(afl, temp_len)]++; + out_buf[rand_below(afl, temp_len)]--; break; }