Ver código fonte

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.)
Andreas Kling 5 anos atrás
pai
commit
30025dd576
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      Libraries/LibC/malloc.cpp

+ 2 - 2
Libraries/LibC/malloc.cpp

@@ -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());
 #endif
 
-    ue_notify_malloc(ptr, size);
-
     if (s_scrub_malloc)
         memset(ptr, MALLOC_SCRUB_BYTE, block->m_size);
+
+    ue_notify_malloc(ptr, size);
     return ptr;
 }