From b1dd93d7b7aa10a4391444c9a4855959d3da19ca Mon Sep 17 00:00:00 2001 From: Simon Lindholm Date: Mon, 2 Oct 2023 16:54:32 +0200 Subject: [PATCH] Zero out TIB Not for any particular reason, but having it contain non-deterministic stack garbage seems like a bad idea. --- main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/main.cpp b/main.cpp index 9b6113f..54a696b 100644 --- a/main.cpp +++ b/main.cpp @@ -345,6 +345,7 @@ int main(int argc, char **argv) { tib.peb->ProcessParameters = (RTL_USER_PROCESS_PARAMETERS*)calloc(sizeof(RTL_USER_PROCESS_PARAMETERS), 1); struct user_desc tibDesc; + memset(&tibDesc, 0, sizeof tibDesc); tibDesc.entry_number = 0; tibDesc.base_addr = (unsigned int) &tib; tibDesc.limit = 0x1000;