mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:27:43 +00:00
LibC: Notify UserspaceEmulator about malloc *after* scrubbing
This makes sure that the emulator marks new malloc memory as uninitialized (even after we've "initialized" it by scrubbing with the scrub byte.)
This commit is contained in:
parent
48eec58bdc
commit
30025dd576
1 changed files with 2 additions and 2 deletions
|
@ -295,10 +295,10 @@ static void* malloc_impl(size_t size)
|
||||||
dbgprintf("LibC: allocated %p (chunk in block %p, size %zu)\n", ptr, block, block->bytes_per_chunk());
|
dbgprintf("LibC: allocated %p (chunk in block %p, size %zu)\n", ptr, block, block->bytes_per_chunk());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ue_notify_malloc(ptr, size);
|
|
||||||
|
|
||||||
if (s_scrub_malloc)
|
if (s_scrub_malloc)
|
||||||
memset(ptr, MALLOC_SCRUB_BYTE, block->m_size);
|
memset(ptr, MALLOC_SCRUB_BYTE, block->m_size);
|
||||||
|
|
||||||
|
ue_notify_malloc(ptr, size);
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue