aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Arbuckle <jeffa.lans@gmail.com>2019-12-21 22:59:20 -0500
committerGreg Hudson <ghudson@mit.edu>2020-01-24 23:07:10 -0500
commitad105209b4701d51437d1ffcc75ee3aa1e45f5ad (patch)
tree4fa9130b64a91d708aee45af6f6c330739d7b945
parent4fecf49c71f4b02bbd9633247f95a1f2f89e5932 (diff)
downloadkrb5-ad105209b4701d51437d1ffcc75ee3aa1e45f5ad.zip
krb5-ad105209b4701d51437d1ffcc75ee3aa1e45f5ad.tar.gz
krb5-ad105209b4701d51437d1ffcc75ee3aa1e45f5ad.tar.bz2
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
-rw-r--r--src/lib/krb5/krb/authdata.c2
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++);