Commit 43cf4e97 authored by Max Kellermann's avatar Max Kellermann

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.
parent 795578ef
...@@ -51,7 +51,10 @@ verify_uri_segment(const char *p) ...@@ -51,7 +51,10 @@ verify_uri_segment(const char *p)
{ {
const char *q; const char *q;
if (*p == 0 || *p == '/' || *p == '.') unsigned dots = 0;
while (*p == '.')
++p;
if (dots <= 2 && (*p == 0 || *p == '/'))
return NULL; return NULL;
q = strchr(p + 1, '/'); q = strchr(p + 1, '/');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment