Skip to content

Commit

Permalink
Merge pull request #91 from ciscon/directorytraversal
Browse files Browse the repository at this point in the history
PATHS: fix for demo names that contain multiple periods in a row
  • Loading branch information
tcsabina authored Apr 18, 2022
2 parents 2c07153 + 21fb5df commit 50c2056
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static const char *FS_GetCleanPath(const char *pattern, char *outbuf, int outlen
*s = '/';
}

if (*pattern == '/' || strstr(pattern, "..") || strstr(pattern, ":"))
if (*pattern == '/' || strstr(pattern, "../") || strstr(pattern, "..\\") || strstr(pattern, ":"))
Con_Printf("Error: absolute path in filename %s\n", pattern);
else
return pattern;
Expand Down

0 comments on commit 50c2056

Please sign in to comment.