Sfoglia il codice sorgente

UserspaceEmulator: Make sure ELF data segments are zero-initialized

(And all other memory, too.) This will mutate later when we add shadow
memory etc, but for now just zero-initialize it since that's expected
by the emulated program.
Andreas Kling 5 anni fa
parent
commit
ce51cf90c6
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      DevTools/UserspaceEmulator/Emulator.cpp

+ 1 - 1
DevTools/UserspaceEmulator/Emulator.cpp

@@ -42,7 +42,7 @@ public:
     SimpleRegion(u32 base, u32 size)
         : Region(base, size)
     {
-        m_data = (u8*)malloc(size);
+        m_data = (u8*)calloc(1, size);
     }
 
     ~SimpleRegion()