msxml3-FreeThreadedXMLHTTP60: Initialize request_body_size when creating the XML HTTP request.

This fixes a crash in TeamTalk 5.
This commit is contained in:
Aida Jonikenė 2023-06-08 12:35:13 -05:00 committed by Zebediah Figura
parent d44a516142
commit e9b0c33d65

View File

@ -1,17 +1,17 @@
From ca9c7d377e3e5e9689d67fbb9622ac1554442cdc Mon Sep 17 00:00:00 2001
From 19e3e3de97851559f2b5d67582e8b58606a4d7ff Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 5 Jan 2023 14:36:08 +1100
Subject: [PATCH 3/4] msxml3: Copy body size to request object
Subject: [PATCH] msxml3: Copy body size to request object
Dont assume that the data needs to be convert
NOTE: should use SetProperty value.
---
dlls/msxml3/httprequest.c | 44 ++++++++++++++++++++++++++-------------
1 file changed, 30 insertions(+), 14 deletions(-)
dlls/msxml3/httprequest.c | 46 +++++++++++++++++++++++++++------------
1 file changed, 32 insertions(+), 14 deletions(-)
diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c
index d8360680411..48ed444576e 100644
index d8360680411..e7e66dec202 100644
--- a/dlls/msxml3/httprequest.c
+++ b/dlls/msxml3/httprequest.c
@@ -117,6 +117,7 @@ typedef struct
@ -39,21 +39,21 @@ index d8360680411..48ed444576e 100644
+ UINT i, cp = CP_ACP;
+
+ for (i = 0; i < len; i++)
+ {
{
- cp = CP_UTF8;
- break;
+ if (str[i] > 127)
+ {
+ cp = CP_UTF8;
+ break;
+ }
+ }
}
+ size = WideCharToMultiByte(cp, 0, str, len, NULL, 0, NULL, NULL);
+ if (!(ptr = heap_alloc(size)))
{
- cp = CP_UTF8;
- break;
+ {
+ heap_free(bsc);
+ return E_OUTOFMEMORY;
}
+ }
+ WideCharToMultiByte(cp, 0, str, len, ptr, size, NULL, NULL);
+ if (cp == CP_UTF8) This->use_utf8_content = TRUE;
}
@ -86,6 +86,15 @@ index d8360680411..48ed444576e 100644
}
hr = httprequest_send(&This->req, body_v);
@@ -2624,6 +2640,8 @@ static void init_httprequest(httprequest *req)
req->threshold = 0x100;
req->enterrprised_id = 0;
req->max_connections = 10;
+
+ req->request_body_size = 0;
}
HRESULT XMLHTTPRequest_create(void **obj)
--
2.39.0
2.40.1