Skip to content

Commit

Permalink
Enable some runtime hardening on win32
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Dec 19, 2023
1 parent a7cd4cc commit 40ae8f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/porting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,13 @@ bool secure_rand_fill_buf(void *buf, size_t len)

void osSpecificInit()
{
// nothing here yet
#ifdef _WIN32
// hardening options
HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
SetSearchPathMode(BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE |
BASE_SEARCH_PATH_PERMANENT);
SetProcessDEPPolicy(PROCESS_DEP_ENABLE);
#endif
}

#endif
Expand Down

0 comments on commit 40ae8f8

Please sign in to comment.