about summary refs log tree commit diff
path: root/qemu_mode/libqasan/string.c
diff options
context:
space:
mode:
authorb1gr3db <73140724+b1gr3db@users.noreply.github.com>2021-02-03 15:32:06 -0500
committerGitHub <noreply@github.com>2021-02-03 15:32:06 -0500
commitd0ab2ded0010fbb2f07920ebcf16bea818507378 (patch)
tree38c9fa22c4f64ee337ec7c83fb20219c211d7109 /qemu_mode/libqasan/string.c
parent58a5372bf0c55ead2a04ed4a4a5b651d68e69292 (diff)
downloadafl++-d0ab2ded0010fbb2f07920ebcf16bea818507378.tar.gz
Create string.c
Off by one error resulted in memmem calling memcmp where h + needle_len is one past the end.
Diffstat (limited to 'qemu_mode/libqasan/string.c')
-rw-r--r--qemu_mode/libqasan/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qemu_mode/libqasan/string.c b/qemu_mode/libqasan/string.c
index c850463b..4be01279 100644
--- a/qemu_mode/libqasan/string.c
+++ b/qemu_mode/libqasan/string.c
@@ -271,7 +271,7 @@ void *__libqasan_memmem(const void *haystack, size_t haystack_len,
 
     }
 
-  } while (h++ <= end);
+  } while (++h <= end);
 
   return 0;