aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/mapper.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mapper.c b/src/mapper.c
index a21b42d92..4510241dc 100644
--- a/src/mapper.c
+++ b/src/mapper.c
@@ -100,6 +100,11 @@ map_directory_child_fs(const struct directory *directory, const char *name,
char buffer2[MPD_PATH_MAX];
const char *parent_fs;
+ /* check for invalid or unauthorized base names */
+ if (*name == 0 || strchr(name, '/') != NULL ||
+ strcmp(name, ".") == 0 || strcmp(name, "..") == 0)
+ return NULL;
+
parent_fs = map_directory_fs(directory, buffer2);
if (parent_fs == NULL)
return NULL;