aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author"Vladimir N. Oleynik" <dzo@simtreas.ru>2006-01-24 12:02:27 +0000
committer"Vladimir N. Oleynik" <dzo@simtreas.ru>2006-01-24 12:02:27 +0000
commitab90b9f427e47d9b2723f5237debe0ee4e0403b5 (patch)
tree3b500cd0324428c36f7f87ab2bc6b046802d2b02
parent8b6063490d5f15cb129da6ea9dee9f6edb63f714 (diff)
downloadbusybox-ab90b9f427e47d9b2723f5237debe0ee4e0403b5.tar.gz
close bug 657
-rw-r--r--networking/httpd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 5df493b8e..70a024bc2 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -1615,13 +1615,6 @@ BAD_REQUEST:
*purl = ' ';
count = sscanf(purl, " %[^ ] HTTP/%d.%*d", buf, &blank);
- test = decodeString(buf, 0);
- if(test == NULL)
- goto BAD_REQUEST;
- if(test == (buf+1)) {
- sendHeaders(HTTP_NOT_FOUND);
- break;
- }
if (count < 1 || buf[0] != '/') {
/* Garbled request/URL */
goto BAD_REQUEST;
@@ -1639,6 +1632,13 @@ BAD_REQUEST:
config->query = test;
}
+ test = decodeString(url, 0);
+ if(test == NULL)
+ goto BAD_REQUEST;
+ if(test == (buf+1)) {
+ sendHeaders(HTTP_NOT_FOUND);
+ break;
+ }
/* algorithm stolen from libbb bb_simplify_path(),
but don`t strdup and reducing trailing slash and protect out root */
purl = test = url;