]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix handling of invalid CAMMAC service verifier 1021/head
authorJeffrey Arbuckle <jeffa.lans@gmail.com>
Sun, 22 Dec 2019 03:59:20 +0000 (22:59 -0500)
committerGreg Hudson <ghudson@mit.edu>
Tue, 7 Jan 2020 21:37:51 +0000 (16:37 -0500)
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

index 3685fcd916f72676c82ecf48cea0f2395ff3a101..7f28883be698debd2979eaceb7ede62464f745f4 100644 (file)
@@ -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++);