Skip to content

Commit

Permalink
this time *really* fix the /../ check ...
Browse files Browse the repository at this point in the history
  • Loading branch information
45264 committed Mar 30, 2001
1 parent 5d3ab9b commit b10ae32
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/s_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1436,9 +1436,6 @@ static int www_body(char *hostname, int s, unsigned char *context)

switch (dot)
{
case 0:
dot = (e[0] == '/') ? 1 : 0;
break;
case 1:
dot = (e[0] == '.') ? 2 : 0;
break;
Expand All @@ -1449,6 +1446,8 @@ static int www_body(char *hostname, int s, unsigned char *context)
dot = (e[0] == '/') ? -1 : 0;
break;
}
if (dot == 0)
dot = (e[0] == '/') ? 1 : 0;
}
dot = (dot == 3) || (dot == -1); /* filename contains ".." component */

Expand Down

0 comments on commit b10ae32

Please sign in to comment.