s3:librpc: Make sure kt_curser and kt_entry are initialized
authorAndreas Schneider <asn@samba.org>
Thu, 16 Feb 2017 16:42:53 +0000 (17:42 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 23 Feb 2017 02:18:10 +0000 (03:18 +0100)
Found by covscan.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12592

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/librpc/crypto/gse_krb5.c

index 83afd16e7cef87861ecc2a90e248534998082fac..703d1b4c92505a980ac7297e1ff60407d1d1ccc7 100644 (file)
@@ -359,8 +359,8 @@ static krb5_error_code fill_mem_keytab_from_system_keytab(krb5_context krbctx,
 {
        krb5_error_code ret = 0;
        krb5_keytab keytab = NULL;
-       krb5_kt_cursor kt_cursor;
-       krb5_keytab_entry kt_entry;
+       krb5_kt_cursor kt_cursor = { 0, };
+       krb5_keytab_entry kt_entry = { 0, };
        char *valid_princ_formats[7] = { NULL, NULL, NULL,
                                         NULL, NULL, NULL, NULL };
        char *entry_princ_s = NULL;
@@ -420,9 +420,6 @@ static krb5_error_code fill_mem_keytab_from_system_keytab(krb5_context krbctx,
                goto out;
        }
 
-       ZERO_STRUCT(kt_entry);
-       ZERO_STRUCT(kt_cursor);
-
        ret = smb_krb5_kt_open_relative(krbctx, NULL, false, &keytab);
        if (ret) {
                DEBUG(1, ("smb_krb5_kt_open failed (%s)\n",