Hans Leidekker : secur32: Validate the context handle in schan_InitializeSecurityContextW().

Alexandre Julliard julliard at winehq.org
Fri Oct 29 16:29:07 CDT 2021


Module: wine
Branch: master
Commit: c1993458ac3b4be9af4f8c47f5de2cbd739f902b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c1993458ac3b4be9af4f8c47f5de2cbd739f902b

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu Oct 28 20:19:27 2021 +0200

secur32: Validate the context handle in schan_InitializeSecurityContextW().

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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);




More information about the wine-cvs mailing list