aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-02-27 18:56:47 +0100
committerMax Kellermann <max@duempel.org>2010-02-27 18:56:47 +0100
commit43cf4e97b9895e37e7f12fad87f5fa5bb0e83d24 (patch)
treea988b8c8c0993a015adf0a94e706569cfa0b5eaa
parent795578ef9596c3cd02facb48aa9b4b6b73b2ee26 (diff)
downloadmpd-43cf4e97b9895e37e7f12fad87f5fa5bb0e83d24.tar.gz
mpd-43cf4e97b9895e37e7f12fad87f5fa5bb0e83d24.tar.xz
mpd-43cf4e97b9895e37e7f12fad87f5fa5bb0e83d24.zip
uri: allow leading dots, but explicitly exclude "." and ".."
Dots at the beginning of an URI segment are ok, as long as the special names "." and ".." are not used.
-rw-r--r--src/uri.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/uri.c b/src/uri.c
index 49f2b7f5c..fc4439967 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -51,7 +51,10 @@ verify_uri_segment(const char *p)
{
const char *q;
- if (*p == 0 || *p == '/' || *p == '.')
+ unsigned dots = 0;
+ while (*p == '.')
+ ++p;
+ if (dots <= 2 && (*p == 0 || *p == '/'))
return NULL;
q = strchr(p + 1, '/');