aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-06-25 21:54:45 +0200
committerMax Kellermann <max@duempel.org>2010-06-25 21:56:12 +0200
commitcd21cfc115c429ae69f368efeecc67c30da8ef4a (patch)
tree7243aede36f6df23d957ced03957fb6edc600055 /src
parent05703cf73bf0332fdf4c088af2f0db23a4ea4ca1 (diff)
downloadmpd-cd21cfc115c429ae69f368efeecc67c30da8ef4a.tar.gz
mpd-cd21cfc115c429ae69f368efeecc67c30da8ef4a.tar.xz
mpd-cd21cfc115c429ae69f368efeecc67c30da8ef4a.zip
uri: really count dots in verify_uri_segment()
This buggy implementation failed to allow "..." sequences, because the dot count was always zero. The usefulness of allowing "..." (or more dots) is debatable, but since it's a valid file name, we allow it.
Diffstat (limited to 'src')
-rw-r--r--src/uri.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/uri.c b/src/uri.c
index fc4439967..f4d590a60 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -52,8 +52,11 @@ verify_uri_segment(const char *p)
const char *q;
unsigned dots = 0;
- while (*p == '.')
+ while (*p == '.') {
++p;
+ ++dots;
+ }
+
if (dots <= 2 && (*p == 0 || *p == '/'))
return NULL;