Catch access to paths that are just "." or ".." without any path separator.
This commit is contained in:
parent
62d24e228f
commit
a45afc5d50
|
@ -939,6 +939,10 @@ static int sanitizePlatformIndependentPath(const char *src, char *dst)
|
||||||
while (*src == '/') /* skip initial '/' chars... */
|
while (*src == '/') /* skip initial '/' chars... */
|
||||||
src++;
|
src++;
|
||||||
|
|
||||||
|
/* Make sure the entire string isn't "." or ".." */
|
||||||
|
if ((strcmp(src, ".") == 0) || (strcmp(src, "..") == 0))
|
||||||
|
BAIL(PHYSFS_ERR_BAD_FILENAME, 0);
|
||||||
|
|
||||||
prev = dst;
|
prev = dst;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue