From: Greg Hudson Date: Wed, 28 May 2014 15:36:24 +0000 (-0400) Subject: Fix uninitialized variable bug in KEYRING ccache X-Git-Tag: krb5-1.13-alpha1~123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b8692dad1be01ce0c57ca9d5e92b950c6aba155;p=thirdparty%2Fkrb5.git Fix uninitialized variable bug in KEYRING ccache Commit 5f4a4d7d357fedac5feadc65c09ecf487ff98db8 removed the only unconditional assignment of ret in get_time_offsets, causing the function to return an uninitialized value if nothing goes wrong. Initialize ret at declaration time to fix this. --- diff --git a/src/lib/krb5/ccache/cc_keyring.c b/src/lib/krb5/ccache/cc_keyring.c index 63e49d24ef..43f33ee504 100644 --- a/src/lib/krb5/ccache/cc_keyring.c +++ b/src/lib/krb5/ccache/cc_keyring.c @@ -1439,7 +1439,7 @@ get_time_offsets(krb5_context context, krb5_ccache id, int32_t *time_offset, int32_t *usec_offset) { krcc_data *data = id->data; - krb5_error_code ret; + krb5_error_code ret = 0; key_serial_t key; void *payload = NULL; int psize;