Julian Klemann : http.sys: Do not add URLs with query parameters to queue.

Alexandre Julliard julliard at winehq.org
Fri Jul 8 16:01:03 CDT 2022


Module: wine
Branch: master
Commit: 8e307b2ecd10da6c3c0a917f091eeb8cc8b374db
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=8e307b2ecd10da6c3c0a917f091eeb8cc8b374db

Author: Julian Klemann <jklemann at codeweavers.com>
Date:   Thu Jul  7 16:25:28 2022 -0500

http.sys: Do not add URLs with query parameters to queue.

---

 dlls/http.sys/http.c         | 2 ++
 dlls/httpapi/tests/httpapi.c | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/dlls/http.sys/http.c b/dlls/http.sys/http.c
index 4d2e10c90d9..e16805ccbdb 100644
--- a/dlls/http.sys/http.c
+++ b/dlls/http.sys/http.c
@@ -729,6 +729,8 @@ static NTSTATUS http_add_url(struct request_queue *queue, IRP *irp)
         return STATUS_INVALID_PARAMETER;
     if (!(addr.sin_port = htons(strtol(strchr(params->url + 7, ':') + 1, &endptr, 10))) || *endptr != '/')
         return STATUS_INVALID_PARAMETER;
+    if (strchr(params->url, '?'))
+        return STATUS_INVALID_PARAMETER;
 
     if (!(url = malloc(strlen(params->url)+1)))
         return STATUS_NO_MEMORY;
diff --git a/dlls/httpapi/tests/httpapi.c b/dlls/httpapi/tests/httpapi.c
index f52c584b93b..1d00aa22c50 100644
--- a/dlls/httpapi/tests/httpapi.c
+++ b/dlls/httpapi/tests/httpapi.c
@@ -1210,6 +1210,10 @@ static void test_v1_relative_urls(void)
     ret = HttpAddUrl(queue2, url2, NULL);
     ok(ret == ERROR_ALREADY_EXISTS, "Got error %u.\n", ret);
 
+    swprintf(url2, ARRAY_SIZE(url2), L"http://localhost:%u/barfoo?a=b", port);
+    ret = HttpAddUrl(queue2, url2, NULL);
+    ok(ret == ERROR_INVALID_PARAMETER, "Got error %u.\n", ret);
+
     ret = CloseHandle(queue);
     ok(ret, "Failed to close queue handle, error %lu.\n", GetLastError());
     ret = CloseHandle(queue2);




More information about the wine-cvs mailing list