main.c: Add missing relative path check

This commit is contained in:
Xavier Del Campo Romero 2024-02-19 16:59:22 +01:00
parent c198199a81
commit 0f889b409e
Signed by: xavi
GPG Key ID: 84FF3612A9BF43F2
1 changed files with 5 additions and 1 deletions

6
main.c
View File

@ -393,7 +393,11 @@ end:
static bool path_isrel(const char *const path)
{
if (!strcmp(path, "..") || !strcmp(path, ".") || strstr(path, "/../"))
if (!strcmp(path, "..")
|| !strcmp(path, ".")
|| !strcmp(path, "./")
|| !strcmp(path, "../")
|| strstr(path, "/../"))
return true;
static const char suffix[] = "/..";