diff options
author | Max Kellermann <max@duempel.org> | 2010-06-25 21:54:45 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-06-25 21:56:12 +0200 |
commit | cd21cfc115c429ae69f368efeecc67c30da8ef4a (patch) | |
tree | 7243aede36f6df23d957ced03957fb6edc600055 /src/uri.c | |
parent | 05703cf73bf0332fdf4c088af2f0db23a4ea4ca1 (diff) | |
download | mpd-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/uri.c')
-rw-r--r-- | src/uri.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |