]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Initialize ret in process_pa_data
authorGreg Hudson <ghudson@mit.edu>
Fri, 21 Dec 2012 21:18:34 +0000 (16:18 -0500)
committerGreg Hudson <ghudson@mit.edu>
Fri, 21 Dec 2012 21:21:06 +0000 (16:21 -0500)
If the for loop never consults any preauth modules and must_preauth is
false, we might never set ret, so we need to initialize it.  The bug
was introduced in 5c23bce0e8d3328bb36bc85ee10cfac486b8ae9b and is
detected by some versions of gcc with -O2.

src/lib/krb5/krb/preauth2.c

index a06233c27d268d548ecef675c6642148da9cbb08..8d5439ccf449b0986c583081fa9b099d5cc39d81 100644 (file)
@@ -586,7 +586,7 @@ process_pa_data(krb5_context context, krb5_get_init_creds_opt *opt,
     struct krb5_preauth_context_st *pctx = context->preauth_context;
     struct errinfo save = EMPTY_ERRINFO;
     krb5_pa_data *pa, **pa_ptr, **mod_pa;
-    krb5_error_code ret;
+    krb5_error_code ret = 0;
     clpreauth_handle h;
     int real, i;