From 42f0d9dd77eddab791c636e990f2ec45fe874f25 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 30 Apr 2013 10:15:23 +0000 Subject: [PATCH] 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 --- modules/dav/main/util.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; -- 2.40.0