From: Jo-Philipp Wich Date: Thu, 15 Apr 2010 20:08:56 +0000 (+0000) Subject: uhttpd: fix bug in path canonization introduced by r20883 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=14428874ae15939acd7b7b34d4d78cb1ff88f81b;p=librecmc%2Flibrecmc.git uhttpd: fix bug in path canonization introduced by r20883 SVN-Revision: 20885 --- diff --git a/package/uhttpd/src/uhttpd-utils.c b/package/uhttpd/src/uhttpd-utils.c index e65f2136d6..96c0b82cda 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 != '/') ) ;