1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-09 04:16:08 +00:00

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

This commit is contained in:
Julian Klemann 2022-07-07 16:25:28 -05:00 committed by Alexandre Julliard
parent 296852b258
commit 8e307b2ecd
2 changed files with 6 additions and 0 deletions

View File

@ -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;

View File

@ -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);