0108:trace:secur32:InitializeSecurityContextA 25528220 00000000 (null) 0x0008c13c 0 16 ... 0108:trace:secur32:schan_InitializeSecurityContextA 25528220 00000000 (null) 573756 0 16 ... 0108:trace:secur32:schan_InitializeSecurityContextW 25528220 00000000 (null) 0x0008c13c 0 16 ...
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
--- dlls/secur32/schannel.c | 1 + dlls/secur32/tests/schannel.c | 4 ++++ 2 files changed, 5 insertions(+)
diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c index 6b5df3520a7..22cd9fdf347 100644 --- a/dlls/secur32/schannel.c +++ b/dlls/secur32/schannel.c @@ -1151,6 +1151,7 @@ static SECURITY_STATUS SEC_ENTRY schan_QueryContextAttributesW(
if (!context_handle) return SEC_E_INVALID_HANDLE; ctx = schan_get_object(context_handle->dwLower, SCHAN_HANDLE_CTX); + if (!ctx) return SEC_E_INVALID_HANDLE;
switch(attribute) { diff --git a/dlls/secur32/tests/schannel.c b/dlls/secur32/tests/schannel.c index f0b0b20b08a..5153c9b4a1e 100644 --- a/dlls/secur32/tests/schannel.c +++ b/dlls/secur32/tests/schannel.c @@ -1529,6 +1529,10 @@ static void test_communication(void)
done: DeleteSecurityContext(&context); + + status = QueryContextAttributesW(&context, SECPKG_ATTR_REMOTE_CERT_CONTEXT, (void*)&cert); + ok(status == SEC_E_INVALID_HANDLE, "QueryContextAttributesW(SECPKG_ATTR_REMOTE_CERT_CONTEXT) got %08lx\n", status); + FreeCredentialsHandle(&cred_handle);
CertFreeCertificateContext(cert);
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
0108:trace:secur32:InitializeSecurityContextA 25528220 00000000 (null) 0x0008c13c 0 16 ... 0108:trace:secur32:schan_InitializeSecurityContextA 25528220 00000000 (null) 573756 0 16 ... 0108:trace:secur32:schan_InitializeSecurityContextW 25528220 00000000 (null) 0x0008c13c 0 16 ... --- 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 22cd9fdf347..d95a1282f1e 100644 --- a/dlls/secur32/schannel.c +++ b/dlls/secur32/schannel.c @@ -1030,7 +1030,7 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextA( SECURITY_STATUS ret; SEC_WCHAR *target_name = NULL;
- TRACE("%p %p %s %ld %ld %ld %p %ld %p %p %p %p\n", phCredential, phContext, + TRACE("%p %p %s 0x%08lx %ld %ld %p %ld %p %p %p %p\n", phCredential, phContext, debugstr_a(pszTargetName), fContextReq, Reserved1, TargetDataRep, pInput, Reserved1, phNewContext, pOutput, pfContextAttr, ptsExpiry);
Hans Leidekker (@hans) commented about dlls/secur32/schannel.c:
if (!context_handle) return SEC_E_INVALID_HANDLE; ctx = schan_get_object(context_handle->dwLower, SCHAN_HANDLE_CTX);
- if (!ctx) return SEC_E_INVALID_HANDLE;
You could be shortened to something like this: ``` if (!context_handle || !(ctx = schan_get_object(context_handle->dwLower, SCHAN_HANDLE_CTX)) return SEC_E_INVALID_HANDLE; ```