From f2645c26017591f819344d24dc0a88dc32dde6fd Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 13 Jan 2020 16:36:16 +0800 Subject: [PATCH] windows: Enable heap terminate-on-corruption This is default behavior from Windows 8 onwards, however we still support Windows 7, so it should make sense to explicitly enable this. More info: https://docs.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heapsetinformation --- src/init.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index dc0f2ce05c9..8ad32f4bdb0 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -879,6 +879,9 @@ bool AppInitBasicSetup() #ifdef WIN32 // Enable Data Execution Prevention (DEP) SetProcessDEPPolicy(PROCESS_DEP_ENABLE); + + // Enable heap terminate-on-corruption + HeapSetInformation(nullptr, HeapEnableTerminationOnCorruption, nullptr, 0); #endif if (!SetupNetworking())