From: Graham Leggett Date: Tue, 30 Apr 2013 10:15:23 +0000 (+0000) Subject: mod_dav: Make sure the URI length is calculated correctly. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e6c79aaf3da4a84de3cfa8f1d474120c8967ad4;p=thirdparty%2Fapache%2Fhttpd.git mod_dav: Make sure the URI length is calculated correctly. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1477530 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/dav/main/util.c b/modules/dav/main/util.c index d2aff57a282..743bedb43c0 100644 --- a/modules/dav/main/util.c +++ b/modules/dav/main/util.c @@ -659,9 +659,6 @@ static dav_error * dav_process_if_header(request_rec *r, dav_if_header **p_ih) /* clean up the URI a bit */ ap_getparents(parsed_uri.path); - uri_len = strlen(parsed_uri.path); - if (uri_len > 1 && parsed_uri.path[uri_len - 1] == '/') - parsed_uri.path[--uri_len] = '\0'; /* the resources we will compare to have unencoded paths */ if (ap_unescape_url(parsed_uri.path) != OK) { @@ -670,6 +667,11 @@ static dav_error * dav_process_if_header(request_rec *r, dav_if_header **p_ih) "Invalid percent encoded URI in tagged If-header."); } + uri_len = strlen(parsed_uri.path); + if (uri_len > 1 && parsed_uri.path[uri_len - 1] == '/') { + parsed_uri.path[--uri_len] = '\0'; + } + uri = parsed_uri.path; list_type = tagged; break;