krb5 commit: 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/8451ff6ed57361de585a35f35a39c54dc48172c7
commit 8451ff6ed57361de585a35f35a39c54dc48172c7
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.
    
    ticket: 8856
    tags: pullup
    target_version: 1.17-next

 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 3685fcd..7f28883 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.