From d0ab2ded0010fbb2f07920ebcf16bea818507378 Mon Sep 17 00:00:00 2001 From: b1gr3db <73140724+b1gr3db@users.noreply.github.com> Date: Wed, 3 Feb 2021 15:32:06 -0500 Subject: Create string.c Off by one error resulted in memmem calling memcmp where h + needle_len is one past the end. --- qemu_mode/libqasan/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qemu_mode/libqasan/string.c') 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; -- cgit 1.4.1