]> granicus.if.org Git - apache/commitdiff
mod_dav: Make sure the URI length is calculated correctly.
authorGraham Leggett <minfrin@apache.org>
Tue, 30 Apr 2013 10:15:23 +0000 (10:15 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 30 Apr 2013 10:15:23 +0000 (10:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1477530 13f79535-47bb-0310-9956-ffa450edef68

modules/dav/main/util.c

index d2aff57a282694db12b50ea67625b0dda32ef17d..743bedb43c09f9b60a819d3c09568f36f8ec339f 100644 (file)
@@ -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;