diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2019-01-22 01:04:23 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2019-01-22 01:04:23 -0500 |
commit | 05d20bcac2b2761fd4d5937e25cb1aa6b3be2fd1 (patch) | |
tree | a14ca0a4dfd7f4285e74e0869693e45e4ef8bca8 | |
parent | b31e7840d5403bc640579135b7004793b9ccd6c0 (diff) | |
download | lighttpd-git-05d20bcac2b2761fd4d5937e25cb1aa6b3be2fd1.tar.gz |
[mod_webdav] compare COPY, MOVE Destination scheme
compare COPY, MOVE Destination scheme with request URI scheme
-rw-r--r-- | src/mod_webdav.c | 6 |
1 files 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; |