about summary refs log tree commit diff
path: root/utils/aflpp_driver/aflpp_driver.c
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2024-10-07 16:44:24 +0200
committervanhauser-thc <vh@thc.org>2024-10-07 16:44:24 +0200
commitf9a8b60b3b3eb508234e2303c208acdccc50333e (patch)
tree402d065bc2fed732f8a08c5b3b7f283c6952973d /utils/aflpp_driver/aflpp_driver.c
parent4a1cf0b9af5f14b5899520ef9abc442c8f1087b6 (diff)
downloadafl++-f9a8b60b3b3eb508234e2303c208acdccc50333e.tar.gz
add LLVMFuzzerTestOneInput -1 support for non-asan
Diffstat (limited to 'utils/aflpp_driver/aflpp_driver.c')
-rw-r--r--utils/aflpp_driver/aflpp_driver.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/utils/aflpp_driver/aflpp_driver.c b/utils/aflpp_driver/aflpp_driver.c
index 6e992266..9b79ef9b 100644
--- a/utils/aflpp_driver/aflpp_driver.c
+++ b/utils/aflpp_driver/aflpp_driver.c
@@ -400,7 +400,7 @@ __attribute__((weak)) int LLVMFuzzerRunDriver(
   size_t prev_length = 0;
 
   // for speed only insert asan functions if the target is linked with asan
-  if (__asan_region_is_poisoned) {
+  if (unlikely(__asan_region_is_poisoned)) {
 
     while (__afl_persistent_loop(N)) {
 
@@ -437,7 +437,12 @@ __attribute__((weak)) int LLVMFuzzerRunDriver(
 
     while (__afl_persistent_loop(N)) {
 
-      callback(__afl_fuzz_ptr, *__afl_fuzz_len);
+      if (unlikely(callback(__afl_fuzz_ptr, *__afl_fuzz_len) == -1)) {
+
+        memset(__afl_area_ptr, 0, __afl_map_size);
+        __afl_area_ptr[0] = 1;
+
+      }
 
     }