[PATCH 4/6] secur32: Validate the context handle in schan_InitializeSecurityContextW().

Hans Leidekker hans at codeweavers.com
Thu Oct 28 10:53:07 CDT 2021


Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
 dlls/secur32/schannel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c
index fdf8e990f62..5b1a910a361 100644
--- a/dlls/secur32/schannel.c
+++ b/dlls/secur32/schannel.c
@@ -984,7 +984,7 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
         SIZE_T record_size = 0;
         unsigned char *ptr;
 
-        ctx = schan_get_object(phContext->dwLower, SCHAN_HANDLE_CTX);
+        if (!(ctx = schan_get_object(phContext->dwLower, SCHAN_HANDLE_CTX))) return SEC_E_INVALID_HANDLE;
         if (pInput)
         {
             idx = schan_find_sec_buffer_idx(pInput, 0, SECBUFFER_TOKEN);
-- 
2.30.2




More information about the wine-devel mailing list