Skip to content

Commit

Permalink
Make sure to search DLLs only in safe path, not in current working dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ValdikSS committed Feb 15, 2018
1 parent dc4d0a3 commit aa28d3e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions goodbyedpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ int main(int argc, char *argv[]) {
char *hdr_name_addr = NULL, *hdr_value_addr = NULL;
int hdr_value_len;

// Make sure to search DLLs only in safe path, not in current working dir.
SetDllDirectory("");
SetSearchPathMode(BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT);

if (!running_from_service) {
running_from_service = 1;
if (service_register(argc, argv)) {
Expand Down

0 comments on commit aa28d3e

Please sign in to comment.