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.
This commit is contained in:
@@ -52,8 +52,11 @@ verify_uri_segment(const char *p)
|
|||||||
const char *q;
|
const char *q;
|
||||||
|
|
||||||
unsigned dots = 0;
|
unsigned dots = 0;
|
||||||
while (*p == '.')
|
while (*p == '.') {
|
||||||
++p;
|
++p;
|
||||||
|
++dots;
|
||||||
|
}
|
||||||
|
|
||||||
if (dots <= 2 && (*p == 0 || *p == '/'))
|
if (dots <= 2 && (*p == 0 || *p == '/'))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user