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-Tag: 2.5.0-alpha~5516 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=42f0d9dd77eddab791c636e990f2ec45fe874f25;p=apache 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 d2aff57a28..743bedb43c 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;