From 43cf4e97b9895e37e7f12fad87f5fa5bb0e83d24 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 27 Feb 2010 18:56:47 +0100 Subject: 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. --- src/uri.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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, '/'); -- cgit v1.2.3