From 8451ff6ed57361de585a35f35a39c54dc48172c7 Mon Sep 17 00:00:00 2001 From: Jeffrey Arbuckle Date: Sat, 21 Dec 2019 22:59:20 -0500 Subject: [PATCH] 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 file changed, 2 insertions(+) diff --git a/src/lib/krb5/krb/authdata.c b/src/lib/krb5/krb/authdata.c index 3685fcd916..7f28883be6 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++); -- 2.47.2