summaryrefslogtreecommitdiff
path: root/package/uhttpd/src
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-04-15 20:08:56 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-04-15 20:08:56 +0000
commit14428874ae15939acd7b7b34d4d78cb1ff88f81b (patch)
treed7808041e56206c227f144c7b7a6be2f115417ad /package/uhttpd/src
parent20ef055c2f698618142a280d5cbc010acacfd651 (diff)
downloadmtk-20170518-14428874ae15939acd7b7b34d4d78cb1ff88f81b.zip
mtk-20170518-14428874ae15939acd7b7b34d4d78cb1ff88f81b.tar.gz
mtk-20170518-14428874ae15939acd7b7b34d4d78cb1ff88f81b.tar.bz2
uhttpd: fix bug in path canonization introduced by r20883
SVN-Revision: 20885
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 e65f213..96c0b82 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 != '/') )
;