diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-11 16:58:23 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-11 17:00:07 +0200 |
commit | ca940d72402f5edcb089d64502811ed8cb64c2bc (patch) | |
tree | 19827452778004ab32bd7447d7921e593463ad57 /Userland/Libraries/LibJS | |
parent | c364520c2402b4b395f4e43fcfe3d4af4d546810 (diff) | |
download | serenity-ca940d72402f5edcb089d64502811ed8cb64c2bc.zip |
LibJS: Fix ASAN poisoning range in new HeapBlocks
When poisoning HeapBlock::m_storage, we have to compute the storage size
by excluding the HeapBlock header.
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r-- | Userland/Libraries/LibJS/Heap/HeapBlock.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Heap/HeapBlock.cpp b/Userland/Libraries/LibJS/Heap/HeapBlock.cpp index 000cac593d..fd997857d2 100644 --- a/Userland/Libraries/LibJS/Heap/HeapBlock.cpp +++ b/Userland/Libraries/LibJS/Heap/HeapBlock.cpp @@ -36,7 +36,7 @@ HeapBlock::HeapBlock(Heap& heap, size_t cell_size) , m_cell_size(cell_size) { VERIFY(cell_size >= sizeof(FreelistEntry)); - ASAN_POISON_MEMORY_REGION(m_storage, block_size); + ASAN_POISON_MEMORY_REGION(m_storage, block_size - sizeof(HeapBlock)); } void HeapBlock::deallocate(Cell* cell) |