From c10d59942812434cc5f1a69a2f5de3d7af7bd82a Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 20 Sep 2022 08:49:48 +1000 Subject: [PATCH] Rebase against cb0e4f5f4f7dc10a0933349ad780a11405cd736e. --- patches/patchinstall.sh | 2 +- ...g-header-fields-should-fail-if-they-.patch | 46 +++++++++---------- staging/upstream-commit | 2 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 0c013501..f81d8fa8 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "f5b92137257b9564dca623ee9578c49b4495e220" + echo "cb0e4f5f4f7dc10a0933349ad780a11405cd736e" } # Show version information diff --git a/patches/wininet-Cleanup/0005-wininet-Replacing-header-fields-should-fail-if-they-.patch b/patches/wininet-Cleanup/0005-wininet-Replacing-header-fields-should-fail-if-they-.patch index 96491e29..70f01c0a 100644 --- a/patches/wininet-Cleanup/0005-wininet-Replacing-header-fields-should-fail-if-they-.patch +++ b/patches/wininet-Cleanup/0005-wininet-Replacing-header-fields-should-fail-if-they-.patch @@ -1,4 +1,4 @@ -From 0703846f52cc70153aacee4ef699008da450bfe8 Mon Sep 17 00:00:00 2001 +From ec84f3463bb1750c51e062b80c3ce16dabb972e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 16 May 2015 03:16:15 +0200 Subject: [PATCH] wininet: Replacing header fields should fail if they do not @@ -12,10 +12,10 @@ a way that it behaves identical to the old code in such situations. 1 file changed, 99 insertions(+), 98 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c -index 55698467cda..c618652cfaa 100644 +index 575ebab24c6..132ed61e1de 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c -@@ -6108,130 +6108,131 @@ static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer) +@@ -6112,130 +6112,131 @@ static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer) static DWORD HTTP_ProcessHeader(http_request_t *request, LPCWSTR field, LPCWSTR value, DWORD dwModifier) { @@ -31,23 +31,23 @@ index 55698467cda..c618652cfaa 100644 EnterCriticalSection( &request->headers_section ); - /* REPLACE wins out over ADD */ -- if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) -- dwModifier &= ~HTTP_ADDHDR_FLAG_ADD; -- -- if (dwModifier & HTTP_ADDHDR_FLAG_ADD) -- index = -1; -- else -- index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only); +- if (dwModifier & HTTP_ADDREQ_FLAG_REPLACE) +- dwModifier &= ~HTTP_ADDREQ_FLAG_ADD; + index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only); + if (index >= 0) + { + lphttpHdr = &request->custHeaders[index]; +- if (dwModifier & HTTP_ADDREQ_FLAG_ADD) +- index = -1; +- else +- index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only); +- - if (index >= 0) - { -- if (dwModifier & HTTP_ADDHDR_FLAG_ADD_IF_NEW) +- if (dwModifier & HTTP_ADDREQ_FLAG_ADD_IF_NEW) + /* replace existing header if FLAG_REPLACE is given */ -+ if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) ++ if (dwModifier & HTTP_ADDREQ_FLAG_REPLACE) { - LeaveCriticalSection( &request->headers_section ); - return ERROR_HTTP_INVALID_HEADER; @@ -92,20 +92,20 @@ index 55698467cda..c618652cfaa 100644 + res = HTTP_InsertCustomHeader( request, &hdr ); + } -- if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) +- if (dwModifier & HTTP_ADDREQ_FLAG_REPLACE) - { - HTTP_DeleteCustomHeader( request, index ); + goto out; + } -+ + +- if (value && value[0]) + /* do not add new header if FLAG_ADD_IF_NEW is set */ -+ if (dwModifier & HTTP_ADDHDR_FLAG_ADD_IF_NEW) ++ if (dwModifier & HTTP_ADDREQ_FLAG_ADD_IF_NEW) + { + res = ERROR_HTTP_INVALID_HEADER; /* FIXME */ + goto out; + } - -- if (value && value[0]) ++ + /* handle appending to existing header */ + if (dwModifier & COALESCEFLAGS) { @@ -125,12 +125,12 @@ index 55698467cda..c618652cfaa 100644 - hdr.lpszField = (LPWSTR)field; - hdr.lpszValue = (LPWSTR)value; - hdr.wFlags = hdr.wCount = 0; -+ if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA) ++ if (dwModifier & HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA) + { + ch = ','; + lphttpHdr->wFlags |= HDR_COMMADELIMITED; + } -+ else if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON) ++ else if (dwModifier & HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON) + { + ch = ';'; + lphttpHdr->wFlags |= HDR_COMMADELIMITED; @@ -175,7 +175,7 @@ index 55698467cda..c618652cfaa 100644 + } + + /* FIXME: What about other combinations? */ -+ if ((dwModifier & ~HTTP_ADDHDR_FLAG_REQ) == HTTP_ADDHDR_FLAG_REPLACE) ++ if ((dwModifier & ~HTTP_ADDHDR_FLAG_REQ) == HTTP_ADDREQ_FLAG_REPLACE) { - LPWSTR lpsztmp; - WCHAR ch = 0; @@ -186,12 +186,12 @@ index 55698467cda..c618652cfaa 100644 + goto out; + } -- if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA) +- if (dwModifier & HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA) - { - ch = ','; - lphttpHdr->wFlags |= HDR_COMMADELIMITED; - } -- else if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON) +- else if (dwModifier & HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON) - { - ch = ';'; - lphttpHdr->wFlags |= HDR_COMMADELIMITED; @@ -246,5 +246,5 @@ index 55698467cda..c618652cfaa 100644 /*********************************************************************** -- -2.34.1 +2.35.1 diff --git a/staging/upstream-commit b/staging/upstream-commit index 9044e168..03d20a33 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -f5b92137257b9564dca623ee9578c49b4495e220 +cb0e4f5f4f7dc10a0933349ad780a11405cd736e