krb5 commit [krb5-1.17]: Fix handling of invalid CAMMAC service verifier

Greg Hudson <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/ad105209b4701d51437d1ffcc75ee3aa1e45f5ad
commit ad105209b4701d51437d1ffcc75ee3aa1e45f5ad
Author: Jeffrey Arbuckle <[email protected]>
Date:   Sat Dec 21 22:59:20 2019 -0500

    Fix handling of invalid CAMMAC service verifier
    
    In extract_cammacs(), avoid a null dereference if the CAMMAC service
    verifier is invalid or the CAMMAC is empty.
    
    (cherry picked from commit 8451ff6ed57361de585a35f35a39c54dc48172c7)
    
    ticket: 8856
    version_fixed: 1.17.2

 src/lib/krb5/krb/authdata.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/lib/krb5/krb/authdata.c b/src/lib/krb5/krb/authdata.c
index 7fbcfab..12ac92d 100644
--- a/src/lib/krb5/krb/authdata.c
+++ b/src/lib/krb5/krb/authdata.c
@@ -557,6 +557,8 @@ extract_cammacs(krb5_context kcontext, krb5_authdata **cammacs,
         if (ret && ret != KRB5KRB_AP_ERR_BAD_INTEGRITY)
             goto cleanup;
         ret = 0;
+        if (elements == NULL)
+            continue;
 
         /* Add the verified elements to list and free the container array. */
         for (n_elements = 0; elements[n_elements] != NULL; n_elements++);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.