krb5_wrap: Make sure we don't dereference a NULL pointer.
authorAndreas Schneider <asn@samba.org>
Mon, 25 Feb 2013 13:52:23 +0000 (14:52 +0100)
committerDavid Disseldorp <ddiss@suse.de>
Tue, 5 Mar 2013 22:29:53 +0000 (23:29 +0100)
Reviewed-by: David Disseldorp <ddiss@samba.org>
lib/krb5_wrap/krb5_samba.c

index ffb3f8d00d67ca5e0ec3fe2c255242f891528419..0876ab628452e7086b0943daef3e6ab92f725265 100644 (file)
@@ -1400,7 +1400,9 @@ krb5_error_code smb_krb5_get_credentials(krb5_context context,
        krb5_error_code ret;
        krb5_creds *creds = NULL;
 
-       *out_creds = NULL;
+       if (out_creds != NULL) {
+               *out_creds = NULL;
+       }
 
        if (impersonate_princ) {
 #ifdef HAVE_KRB5_GET_CREDS_OPT_SET_IMPERSONATE /* Heimdal */