From 05d20bcac2b2761fd4d5937e25cb1aa6b3be2fd1 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Tue, 22 Jan 2019 01:04:23 -0500 Subject: [PATCH] [mod_webdav] compare COPY, MOVE Destination scheme compare COPY, MOVE Destination scheme with request URI scheme --- src/mod_webdav.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mod_webdav.c b/src/mod_webdav.c index b1bdab84..67153e3c 100644 --- a/src/mod_webdav.c +++ b/src/mod_webdav.c @@ -1958,12 +1958,14 @@ static handler_t mod_webdav_copymove(server *srv, connection *con, plugin_data * * */ start = destination->ptr; + sep = start + buffer_string_length(con->uri.scheme); - if (NULL == (sep = strstr(start, "://"))) { + if (0 != strncmp(start, con->uri.scheme->ptr, sep - start) + || sep[0] != ':' || sep[1] != '/' || sep[2] != '/') { con->http_status = 400; return HANDLER_FINISHED; } - buffer_copy_string_len(p->uri.scheme, start, sep - start); + buffer_copy_buffer(p->uri.scheme, con->uri.scheme); /*(unused?)*/ start = sep + 3;