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 ...
-- v2: secur32: Trace fContextReq consistently. secur32: QueryContextAttributesW check for valid object before use
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
--- dlls/secur32/schannel.c | 4 ++-- dlls/secur32/tests/schannel.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c index 6b5df3520a7..6b4be497f30 100644 --- a/dlls/secur32/schannel.c +++ b/dlls/secur32/schannel.c @@ -1149,8 +1149,8 @@ static SECURITY_STATUS SEC_ENTRY schan_QueryContextAttributesW( TRACE("context_handle %p, attribute %#lx, buffer %p\n", context_handle, attribute, buffer);
- if (!context_handle) return SEC_E_INVALID_HANDLE; - ctx = schan_get_object(context_handle->dwLower, SCHAN_HANDLE_CTX); + if (!context_handle || !(ctx = schan_get_object(context_handle->dwLower, SCHAN_HANDLE_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 6b4be497f30..05994ed0753 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);
This merge request was approved by Hans Leidekker.