wininet: Avoid a crash on NULL lpcszHeader in HttpSendRequestExW.
This commit is contained in:
parent
bd4bc16147
commit
4990ca0ea3
|
@ -3338,8 +3338,10 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest,
|
|||
req = &workRequest.u.HttpSendRequestW;
|
||||
if (lpBuffersIn)
|
||||
{
|
||||
DWORD size;
|
||||
DWORD size = 0;
|
||||
|
||||
if (lpBuffersIn->lpcszHeader)
|
||||
{
|
||||
if (lpBuffersIn->dwHeadersLength == ~0u)
|
||||
size = (strlenW( lpBuffersIn->lpcszHeader ) + 1) * sizeof(WCHAR);
|
||||
else
|
||||
|
@ -3347,8 +3349,10 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest,
|
|||
|
||||
req->lpszHeader = HeapAlloc( GetProcessHeap(), 0, size );
|
||||
memcpy( req->lpszHeader, lpBuffersIn->lpcszHeader, size );
|
||||
}
|
||||
else req->lpszHeader = NULL;
|
||||
|
||||
req->dwHeaderLength = lpBuffersIn->dwHeadersLength;
|
||||
req->dwHeaderLength = size / sizeof(WCHAR);
|
||||
req->lpOptional = lpBuffersIn->lpvBuffer;
|
||||
req->dwOptionalLength = lpBuffersIn->dwBufferLength;
|
||||
req->dwContentLength = lpBuffersIn->dwBufferTotal;
|
||||
|
|
Loading…
Reference in New Issue