]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix garbage return in extract_cammacs()
authorRobbie Harwood <rharwood@redhat.com>
Mon, 18 Jun 2018 21:49:52 +0000 (17:49 -0400)
committerGreg Hudson <ghudson@mit.edu>
Tue, 26 Jun 2018 15:06:27 +0000 (11:06 -0400)
If no cammacs were present, we would never initialize ret before
returning it.  (extract_cammcs() is currently never called with an
empty or null list, so this does not manifest as a bug.)

[ghudson@mit.edu: amended commit message]

src/lib/krb5/krb/authdata.c

index 8fd1f05387b17ebf9706b0c5782a3627d320b30c..7fbcfab686ce7d5cd82f26e60cd1fdb94802e218 100644 (file)
@@ -546,7 +546,7 @@ static krb5_error_code
 extract_cammacs(krb5_context kcontext, krb5_authdata **cammacs,
                 const krb5_keyblock *key, krb5_authdata ***ad_out)
 {
-    krb5_error_code ret;
+    krb5_error_code ret = 0;
     krb5_authdata **list = NULL, **elements = NULL, **new_list;
     size_t i, n_elements, count = 0;