From 3fb2a32b8342b040ff0310cb4f5e69c671dc0369 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Sun, 26 Apr 2026 21:14:54 +0200 Subject: [PATCH] Fix: prevent cases where // in paths could broke stat() --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index dd2f127..345f897 100644 --- a/src/main.c +++ b/src/main.c @@ -120,7 +120,7 @@ arg_next: tempUnFixedName++; // shifts and removes the ~ directoriesArray[i] = malloc(PATH_MAX); debug("~ in %s was expanded to %s", tempUnFixedName, homedir); - snprintf(directoriesArray[i], PATH_MAX, "%s/%s", homedir, tempUnFixedName); + snprintf(directoriesArray[i], PATH_MAX, "%s%s", homedir, tempUnFixedName); } else { directoriesArray[i] = strdup(cJSON_GetStringValue(tempEntry)); altDebug("%s\n",directoriesArray[i]);