[PATCH] kerberos: Avoid a crash on NULL expiry parameter.

Hans Leidekker hans at codeweavers.com
Tue Jan 11 06:34:50 CST 2022


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52353
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
 dlls/kerberos/krb5_ap.c      | 1 +
 dlls/secur32/tests/secur32.c | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/kerberos/krb5_ap.c b/dlls/kerberos/krb5_ap.c
index 8295d2e103e..2e47c23bb69 100644
--- a/dlls/kerberos/krb5_ap.c
+++ b/dlls/kerberos/krb5_ap.c
@@ -87,6 +87,7 @@ static void expiry_to_timestamp( ULONG expiry, TimeStamp *timestamp )
 {
     LARGE_INTEGER time;
 
+    if (!timestamp) return;
     NtQuerySystemTime( &time );
     RtlSystemTimeToLocalTime( &time, &time );
     time.QuadPart += expiry * (ULONGLONG)10000000;
diff --git a/dlls/secur32/tests/secur32.c b/dlls/secur32/tests/secur32.c
index f6bca55561c..aa286c64732 100644
--- a/dlls/secur32/tests/secur32.c
+++ b/dlls/secur32/tests/secur32.c
@@ -418,7 +418,6 @@ static void test_SspiPrepareForCredWrite(void)
 static void test_kerberos(void)
 {
     SecPkgInfoA *info;
-    TimeStamp ttl;
     CredHandle cred;
     SECURITY_STATUS status;
 
@@ -460,7 +459,7 @@ static void test_kerberos(void)
     FreeContextBuffer( info );
 
     status = AcquireCredentialsHandleA( NULL, provider, SECPKG_CRED_OUTBOUND, NULL,
-                                        NULL, NULL, NULL, &cred, &ttl );
+                                        NULL, NULL, NULL, &cred, NULL );
     todo_wine ok( status == SEC_E_OK, "AcquireCredentialsHandleA returned %08x\n", status );
     if(status == SEC_E_OK)
         FreeCredentialHandle( &cred );
-- 
2.30.2




More information about the wine-devel mailing list