The branch, master has been updated
       via  e46cb9b s3: krb5: keytab - The done label can be jumped to with 
context == NULL.
      from  0e2711b lib: Fix uninitialized read in msghdr_copy

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e46cb9b835eb8f2bd998def82baf6f07fda9fe5c
Author: Jeremy Allison <j...@samba.org>
Date:   Wed Jun 8 14:50:59 2016 -0700

    s3: krb5: keytab - The done label can be jumped to with context == NULL.
    
    Ensure we don't crash in this case.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11959
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Uri Simchoni <u...@samba.org>
    
    Autobuild-User(master): Uri Simchoni <u...@samba.org>
    Autobuild-Date(master): Thu Jun  9 13:18:56 CEST 2016 on sn-devel-144

-----------------------------------------------------------------------

Summary of changes:
 source3/libads/kerberos_keytab.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libads/kerberos_keytab.c b/source3/libads/kerberos_keytab.c
index 731895e..160b5839 100644
--- a/source3/libads/kerberos_keytab.c
+++ b/source3/libads/kerberos_keytab.c
@@ -552,26 +552,24 @@ done:
        TALLOC_FREE(oldEntries);
        TALLOC_FREE(frame);
 
-       {
+       if (context) {
                krb5_keytab_entry zero_kt_entry;
+               krb5_kt_cursor zero_csr;
+
                ZERO_STRUCT(zero_kt_entry);
+               ZERO_STRUCT(zero_csr);
+
                if (memcmp(&zero_kt_entry, &kt_entry,
                                sizeof(krb5_keytab_entry))) {
                        smb_krb5_kt_free_entry(context, &kt_entry);
                }
-       }
-       {
-               krb5_kt_cursor zero_csr;
-               ZERO_STRUCT(zero_csr);
                if ((memcmp(&cursor, &zero_csr,
                                sizeof(krb5_kt_cursor)) != 0) && keytab) {
                        krb5_kt_end_seq_get(context, keytab, &cursor);
                }
-       }
-       if (keytab) {
-               krb5_kt_close(context, keytab);
-       }
-       if (context) {
+               if (keytab) {
+                       krb5_kt_close(context, keytab);
+               }
                krb5_free_context(context);
        }
        return ret;


-- 
Samba Shared Repository

Reply via email to