summaryrefslogtreecommitdiffstats
path: root/package/uhttpd/src
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-04-15 20:08:56 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-04-15 20:08:56 +0000
commitb092b4323d03b18ee2213d22274a73b1bd14d595 (patch)
treed49c3ae49cfe8d984a9a1272396c5600d366fe9c /package/uhttpd/src
parentcbe586a91926490315c183de105cba6ee4872d1e (diff)
[package] uhttpd: fix bug in path canonization introduced by r20883
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20885 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/uhttpd/src')
-rw-r--r--package/uhttpd/src/uhttpd-utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/package/uhttpd/src/uhttpd-utils.c b/package/uhttpd/src/uhttpd-utils.c
index e65f2136d..96c0b82cd 100644
--- a/package/uhttpd/src/uhttpd-utils.c
+++ b/package/uhttpd/src/uhttpd-utils.c
@@ -420,8 +420,9 @@ static char * canonpath(const char *path, char *path_resolved)
}
/* collapse /x/../ */
- else if( path_cpy[2] == '.' )
- {
+ else if( (path_cpy[2] == '.') &&
+ ((path_cpy[3] == '/') || (path_cpy[3] == '\0'))
+ ) {
while( (path_res > path_resolved) && (*--path_res != '/') )
;