Merge remote-tracking branch 'teor/bug27461-032' into maint-0.3.2

This commit is contained in:
Nick Mathewson 2018-09-07 08:46:41 -04:00
commit eacaff6ccc
2 changed files with 13 additions and 0 deletions

5
changes/bug27461 Normal file
View File

@ -0,0 +1,5 @@
o Minor bugfixes (compilation):
- Stop calling SetProcessDEPPolicy() on 64-bit Windows. It is not
supported, and always fails. Some compilers warn about the function
pointer cast on 64-bit Windows.
Fixes bug 27461; bugfix on 0.2.2.23-alpha.

View File

@ -3719,6 +3719,13 @@ tor_main(int argc, char *argv[])
#endif
/* On heap corruption, just give up; don't try to play along. */
HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
/* SetProcessDEPPolicy is only supported on 32-bit Windows.
* (On 64-bit Windows it always fails, and some compilers don't like the
* PSETDEP cast.)
* 32-bit Windows defines _WIN32.
* 64-bit Windows defines _WIN32 and _WIN64. */
#ifndef _WIN64
/* Call SetProcessDEPPolicy to permanently enable DEP.
The function will not resolve on earlier versions of Windows,
and failure is not dangerous. */
@ -3732,6 +3739,7 @@ tor_main(int argc, char *argv[])
setdeppolicy(3);
}
}
#endif /* !defined(_WIN64) */
#endif /* defined(_WIN32) */
configure_backtrace_handler(get_version());