From cd21cfc115c429ae69f368efeecc67c30da8ef4a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 25 Jun 2010 21:54:45 +0200 Subject: 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. --- src/uri.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/uri.c') 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; -- cgit v1.2.3