From bda63f82bf8f74febeac81f895d7eec7c08c77ca Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Tue, 11 Oct 2022 13:46:01 +0200 Subject: [PATCH] Backport fix for AFL++ issue #1548 (#826) --- libafl_qemu/libqasan/malloc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libafl_qemu/libqasan/malloc.c b/libafl_qemu/libqasan/malloc.c index 61f5835ea5..0f64241e21 100644 --- a/libafl_qemu/libqasan/malloc.c +++ b/libafl_qemu/libqasan/malloc.c @@ -276,9 +276,7 @@ int __libqasan_posix_memalign(void **ptr, size_t align, size_t len) { return 0; } - size_t rem = len % align; - size_t size = len; - if (rem) size += rem; + size_t size = len + align; int state = QASAN_SWAP(QASAN_DISABLED); // disable qasan for this thread