diff options
author | Stefan Fritsch <sf@sfritsch.de> | 2013-07-20 22:21:25 +0200 |
---|---|---|
committer | Stefan Fritsch <sf@sfritsch.de> | 2013-07-20 22:21:25 +0200 |
commit | 4a336a5b117419c33c29eadd6409c69df78cd586 (patch) | |
tree | c9787e4bd0f1be8f471e1883262a695a6c4e954f /modules/dav/main/util.c | |
parent | 717c182588f1eb0b7ef189a709f858b44e348489 (diff) | |
download | apache2-upstream/2.4.6.tar.gz |
Imported Upstream version 2.4.6upstream/2.4.6
Diffstat (limited to 'modules/dav/main/util.c')
-rw-r--r-- | modules/dav/main/util.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/modules/dav/main/util.c b/modules/dav/main/util.c index aa085841..ab42af02 100644 --- a/modules/dav/main/util.c +++ b/modules/dav/main/util.c @@ -77,6 +77,30 @@ DAV_DECLARE(dav_error*) dav_push_error(apr_pool_t *p, int status, return err; } +DAV_DECLARE(dav_error*) dav_join_error(dav_error *dest, dav_error *src) +{ + dav_error *curr = dest; + + /* src error doesn't exist so nothing to join just return dest */ + if (src == NULL) { + return dest; + } + + /* dest error doesn't exist so nothing to join just return src */ + if (curr == NULL) { + return src; + } + + /* find last error in dest stack */ + while (curr->prev != NULL) { + curr = curr->prev; + } + + /* add the src error onto end of dest stack and return it */ + curr->prev = src; + return dest; +} + DAV_DECLARE(void) dav_check_bufsize(apr_pool_t * p, dav_buffer *pbuf, apr_size_t extra_needed) { @@ -635,9 +659,19 @@ 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); + + /* the resources we will compare to have unencoded paths */ + if (ap_unescape_url(parsed_uri.path) != OK) { + return dav_new_error(r->pool, HTTP_BAD_REQUEST, + DAV_ERR_IF_TAGGED, rv, + "Invalid percent encoded URI in " + "tagged If-header."); + } + uri_len = strlen(parsed_uri.path); - if (uri_len > 1 && parsed_uri.path[uri_len - 1] == '/') + if (uri_len > 1 && parsed_uri.path[uri_len - 1] == '/') { parsed_uri.path[--uri_len] = '\0'; + } uri = parsed_uri.path; list_type = tagged; |