mirror of
https://github.com/reactos/wine.git
synced 2024-11-29 22:50:43 +00:00
wininet: Avoid accessing uninitialized memory in HttpSendRequestExW.
Found by valgrind.
This commit is contained in:
parent
b707a523e3
commit
e62fdaf0f1
@ -3338,8 +3338,16 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest,
|
||||
req = &workRequest.u.HttpSendRequestW;
|
||||
if (lpBuffersIn)
|
||||
{
|
||||
/* FIXME: this should use dwHeadersLength or may not be necessary at all */
|
||||
req->lpszHeader = heap_strdupW(lpBuffersIn->lpcszHeader);
|
||||
DWORD size;
|
||||
|
||||
if (lpBuffersIn->dwHeadersLength == ~0u)
|
||||
size = (strlenW( lpBuffersIn->lpcszHeader ) + 1) * sizeof(WCHAR);
|
||||
else
|
||||
size = lpBuffersIn->dwHeadersLength * sizeof(WCHAR);
|
||||
|
||||
req->lpszHeader = HeapAlloc( GetProcessHeap(), 0, size );
|
||||
memcpy( req->lpszHeader, lpBuffersIn->lpcszHeader, size );
|
||||
|
||||
req->dwHeaderLength = lpBuffersIn->dwHeadersLength;
|
||||
req->lpOptional = lpBuffersIn->lpvBuffer;
|
||||
req->dwOptionalLength = lpBuffersIn->dwBufferLength;
|
||||
|
Loading…
Reference in New Issue
Block a user