From 5d138768e981a71f0c803e07f0ab307aa6b61de0 Mon Sep 17 00:00:00 2001 From: JalonSolov Date: Mon, 21 Jun 2021 00:05:01 -0400 Subject: [PATCH] net: prevent 0xC0000005 errors in vschannel (windows ssl) (#10531) --- thirdparty/vschannel/vschannel.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/thirdparty/vschannel/vschannel.c b/thirdparty/vschannel/vschannel.c index aed9d3dada..5753298496 100644 --- a/thirdparty/vschannel/vschannel.c +++ b/thirdparty/vschannel/vschannel.c @@ -507,7 +507,7 @@ static SECURITY_STATUS client_handshake_loop(TlsContext *tls_ctx, BOOL fDoInitia // Allocate data buffer. // - IoBuffer = LocalAlloc(LMEM_FIXED, IO_BUFFER_SIZE); + IoBuffer = LocalAlloc(LPTR, IO_BUFFER_SIZE); if(IoBuffer == NULL) { wprintf(L"Out of memory (1)\n"); @@ -630,8 +630,7 @@ static SECURITY_STATUS client_handshake_loop(TlsContext *tls_ctx, BOOL fDoInitia if(InBuffers[1].BufferType == SECBUFFER_EXTRA) { - pExtraData->pvBuffer = LocalAlloc(LMEM_FIXED, - InBuffers[1].cbBuffer); + pExtraData->pvBuffer = LocalAlloc(LPTR, InBuffers[1].cbBuffer); if(pExtraData->pvBuffer == NULL) { wprintf(L"Out of memory (2)\n"); return SEC_E_INTERNAL_ERROR; @@ -741,7 +740,7 @@ static SECURITY_STATUS https_make_request(TlsContext *tls_ctx, CHAR *req, CHAR * // size of this plus the header and trailer sizes should be safe enough. cbIoBufferLength = Sizes.cbHeader + Sizes.cbMaximumMessage + Sizes.cbTrailer; - pbIoBuffer = LocalAlloc(LMEM_FIXED, cbIoBufferLength); + pbIoBuffer = LocalAlloc(LPTR, cbIoBufferLength); if(pbIoBuffer == NULL) { wprintf(L"Out of memory (2)\n"); return SEC_E_INTERNAL_ERROR;