Merge in fixes from 0.9.6-stable.

This commit is contained in:
Richard Levitte
2001-03-30 13:40:16 +00:00
parent 4c37da8051
commit 6b4580887e
11 changed files with 110 additions and 70 deletions

View File

@@ -1386,15 +1386,30 @@ static int www_body(char *hostname, int s, unsigned char *context)
/* skip the '/' */
p= &(buf[5]);
dot=0;
dot = 1;
for (e=p; *e != '\0'; e++)
{
if (e[0] == ' ') break;
if ( (e[0] == '.') &&
(strncmp(&(e[-1]),"/../",4) == 0))
dot=1;
if (e[0] == ' ')
break;
switch (dot)
{
case 0:
dot = (e[0] == '/') ? 1 : 0;
break;
case 1:
dot = (e[0] == '.') ? 2 : 0;
break;
case 2:
dot = (e[0] == '.') ? 3 : 0;
break;
case 3:
dot = (e[0] == '/') ? -1 : 0;
break;
}
}
dot = (dot == 3) || (dot == -1); /* filename contains ".." component */
if (*e == '\0')
{