diff --git a/src/engine/shared/storage.cpp b/src/engine/shared/storage.cpp
index 8018be096..82d8adbb6 100644
--- a/src/engine/shared/storage.cpp
+++ b/src/engine/shared/storage.cpp
@@ -3,7 +3,6 @@
#include
#include
#include "linereader.h"
-#include
// compiled-in data-dir path
#define DATA_DIR "data"
@@ -281,7 +280,11 @@ public:
BufferSize = sizeof(aBuffer);
}
- if(pFilename[0] == '/' || pFilename[0] == '\\' || strstr(pFilename, "../") != NULL || strstr(pFilename, "..\\") != NULL)
+ if(pFilename[0] == '/' || pFilename[0] == '\\' || str_find(pFilename, "../") != NULL || str_find(pFilename, "..\\") != NULL
+ #ifdef CONF_FAMILY_WINDOWS
+ || (pFilename[0] && pFilename[1] == ':')
+ #endif
+ )
{
// don't escape base directory
}