diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-04-15 20:08:56 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-04-15 20:08:56 +0000 |
commit | 7119535b127e559bec1d5949591f8f0fc30affe8 (patch) | |
tree | d49c3ae49cfe8d984a9a1272396c5600d366fe9c /package | |
parent | 3fe0660216685084435ec28804aebab2d0d3a358 (diff) | |
download | upstream-7119535b127e559bec1d5949591f8f0fc30affe8.tar.gz upstream-7119535b127e559bec1d5949591f8f0fc30affe8.tar.bz2 upstream-7119535b127e559bec1d5949591f8f0fc30affe8.zip |
[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')
-rw-r--r-- | package/uhttpd/src/uhttpd-utils.c | 5 |
1 files changed, 3 insertions, 2 deletions
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 != '/') ) ; |