From 2f83cfdb90d687673cfc4be14cd66425fb7f3e76 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 16 Feb 2017 17:42:53 +0100 Subject: [PATCH] s3:librpc: Make sure kt_curser and kt_entry are initialized Found by covscan. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12592 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- source3/librpc/crypto/gse_krb5.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source3/librpc/crypto/gse_krb5.c b/source3/librpc/crypto/gse_krb5.c index 83afd16e7ce..703d1b4c925 100644 --- a/source3/librpc/crypto/gse_krb5.c +++ b/source3/librpc/crypto/gse_krb5.c @@ -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",