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.
This commit is contained in:
Max Kellermann 2010-02-27 18:56:47 +01:00
parent 795578ef95
commit 43cf4e97b9
1 changed files with 4 additions and 1 deletions

View File

@ -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, '/');