From: Robbie Harwood Date: Mon, 18 Jun 2018 21:49:52 +0000 (-0400) Subject: Fix garbage return in extract_cammacs() X-Git-Tag: krb5-1.17-beta1~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b3384c4bb91031a8cc648ecef2b20b8a4480e73;p=thirdparty%2Fkrb5.git Fix garbage return in extract_cammacs() 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] --- diff --git a/src/lib/krb5/krb/authdata.c b/src/lib/krb5/krb/authdata.c index 8fd1f05387..7fbcfab686 100644 --- a/src/lib/krb5/krb/authdata.c +++ b/src/lib/krb5/krb/authdata.c @@ -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;