From 173f09df352ed205867d3a3b8b40e816c2304373 Mon Sep 17 00:00:00 2001 From: kobalicek Date: Sat, 26 Dec 2020 20:12:14 +0100 Subject: [PATCH] [Bug] Fixed invalid fill in JitAllocator::shrink() when kOptionFillUnusedMemory is in use by JitAllocator (Critical) --- src/asmjit/core/jitallocator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/asmjit/core/jitallocator.cpp b/src/asmjit/core/jitallocator.cpp index 340c440..952164e 100644 --- a/src/asmjit/core/jitallocator.cpp +++ b/src/asmjit/core/jitallocator.cpp @@ -873,7 +873,7 @@ Error JitAllocator::shrink(void* ro, size_t newSize) noexcept { // Fill released memory if the secure mode is enabled. if (impl->options & kOptionFillUnusedMemory) JitAllocatorImpl_fillPattern( - block->rwPtr() + (areaIndex + areaOldSize) * pool->granularity, + block->rwPtr() + (areaIndex + areaNewSize) * pool->granularity, fillPattern(), areaDiff * pool->granularity);