X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/cbe586a91926490315c183de105cba6ee4872d1e..13e93684560de2faa88008652e776d0611f24a40:/package/uhttpd/src/uhttpd-utils.c?ds=sidebyside diff --git a/package/uhttpd/src/uhttpd-utils.c b/package/uhttpd/src/uhttpd-utils.c index e65f2136d..caa6b12bc 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 != '/') ) ; @@ -621,10 +622,14 @@ struct auth_realm * uh_auth_add(char *path, char *user, char *pass) min(strlen(pass), sizeof(new->pass) - 1)); } - uh_realm_count++; + if( new->pass[0] ) + { + uh_realm_count++; + return new; + } } - return new; + return NULL; } int uh_auth_check(