diff options
author | Max Kellermann <max@duempel.org> | 2010-02-27 18:56:47 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-02-27 18:56:47 +0100 |
commit | 43cf4e97b9895e37e7f12fad87f5fa5bb0e83d24 (patch) | |
tree | a988b8c8c0993a015adf0a94e706569cfa0b5eaa /src | |
parent | 795578ef9596c3cd02facb48aa9b4b6b73b2ee26 (diff) | |
download | mpd-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.
Diffstat (limited to 'src')
-rw-r--r-- | src/uri.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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, '/'); |