diff --git a/src/util-path.c b/src/util-path.c index 072133c04b..8226704b0d 100644 --- a/src/util-path.c +++ b/src/util-path.c @@ -268,11 +268,11 @@ const char *SCBasename(const char *path) bool SCPathContainsTraversal(const char *path) { #ifdef OS_WIN32 - const char *pattern = "..\\"; + /* Win32 treats '/' and '\\' as equivalent directory separators */ + return strstr(path, "../") != NULL || strstr(path, "..\\") != NULL; #else - const char *pattern = "../"; + return strstr(path, "../") != NULL; #endif - return strstr(path, pattern) != NULL; } /**