From ce51cf90c66ea25f9675fda301913e973fefde75 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 12 Jul 2020 00:27:25 +0200 Subject: [PATCH] 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. --- DevTools/UserspaceEmulator/Emulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DevTools/UserspaceEmulator/Emulator.cpp b/DevTools/UserspaceEmulator/Emulator.cpp index af7baadac3..0b0654143e 100644 --- a/DevTools/UserspaceEmulator/Emulator.cpp +++ b/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()