aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-13 11:13:18 -0500
committerNick Mathewson <nickm@torproject.org>2017-11-13 11:13:18 -0500
commitc928fb988a6679cc5aca380bcc568b165e5f7c4a (patch)
treeb765dc9852d47420ed713ada76df6fab277c0a48 /src/or
parent9666c620d584b2c715596b415a808941b17cbda0 (diff)
parent15cc41e6649009ccd92d927850f918b962ee35d6 (diff)
downloadtor-c928fb988a6679cc5aca380bcc568b165e5f7c4a.tar.gz
tor-c928fb988a6679cc5aca380bcc568b165e5f7c4a.zip
Merge branch 'ticket21953_029' into maint-0.2.9
Diffstat (limited to 'src/or')
-rw-r--r--src/or/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 66a8571901..187b255bfb 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -3426,6 +3426,11 @@ tor_main(int argc, char *argv[])
int result = 0;
#ifdef _WIN32
+#ifndef HeapEnableTerminationOnCorruption
+#define HeapEnableTerminationOnCorruption 1
+#endif
+ /* On heap corruption, just give up; don't try to play along. */
+ HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
/* Call SetProcessDEPPolicy to permanently enable DEP.
The function will not resolve on earlier versions of Windows,
and failure is not dangerous. */
@@ -3434,7 +3439,10 @@ tor_main(int argc, char *argv[])
typedef BOOL (WINAPI *PSETDEP)(DWORD);
PSETDEP setdeppolicy = (PSETDEP)GetProcAddress(hMod,
"SetProcessDEPPolicy");
- if (setdeppolicy) setdeppolicy(1); /* PROCESS_DEP_ENABLE */
+ if (setdeppolicy) {
+ /* PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION */
+ setdeppolicy(3);
+ }
}
#endif