summaryrefslogtreecommitdiff
path: root/networking/httpd.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-04-13 23:59:52 +0000
committerDenis Vlasenko2007-04-13 23:59:52 +0000
commit16abcd90aefae8bdb9f7d80a555982dba6ca59b5 (patch)
treeb7e23fd3c844849d188813323076c93105a57d4d /networking/httpd.c
parent334fa9bcb50df9a03288be252096750dcec14404 (diff)
downloadbusybox-16abcd90aefae8bdb9f7d80a555982dba6ca59b5.zip
busybox-16abcd90aefae8bdb9f7d80a555982dba6ca59b5.tar.gz
teach find_root_device to deal with /dev/ subdirs
(by "Kirill K. Smirnov" <lich@math.spbu.ru>)
Diffstat (limited to 'networking/httpd.c')
-rw-r--r--networking/httpd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index d80df93..1f7c886 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -1573,7 +1573,7 @@ static void handleIncoming(void)
}
/* algorithm stolen from libbb bb_simplify_path(),
- but don't strdup and reducing trailing slash and protect out root */
+ * but don't strdup and reducing trailing slash and protect out root */
purl = test = url;
do {
if (*purl == '/') {
@@ -1583,18 +1583,18 @@ static void handleIncoming(void)
}
if (*test == '.') {
/* skip extra '.' */
- if (test[1] == '/' || test[1] == 0) {
+ if (test[1] == '/' || !test[1]) {
continue;
- } else
+ }
/* '..': be careful */
- if (test[1] == '.' && (test[2] == '/' || test[2] == 0)) {
+ if (test[1] == '.' && (test[2] == '/' || !test[2])) {
++test;
if (purl == url) {
/* protect out root */
goto BAD_REQUEST;
}
while (*--purl != '/') /* omit previous dir */;
- continue;
+ continue;
}
}
}