Skip to content

Commit

Permalink
Prevent the user from inserting forward slashes in the Windows path
Browse files Browse the repository at this point in the history
  • Loading branch information
bah07 committed Jun 28, 2018
1 parent 5b42d6d commit 735f7b2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/config/syscheck-config.c
Expand Up @@ -38,6 +38,17 @@ int dump_syscheck_entry(syscheck_config *syscheck, const char *entry, int vals,
}

else {
#ifdef WIN32
char *ptfile;
/* Change forward slashes to backslashes on entry */
ptfile = strchr(entry, '/');
while (ptfile) {
*ptfile = '\\';
ptfile++;

ptfile = strchr(ptfile, '/');
}
#endif
if (syscheck->dir == NULL) {
os_calloc(2, sizeof(char *), syscheck->dir);
syscheck->dir[pl + 1] = NULL;
Expand Down

0 comments on commit 735f7b2

Please sign in to comment.