krb5 commit: Fix uninitialized variable bug in KEYRING ccache

Greg Hudson ghudson at MIT.EDU
Wed May 28 12:17:06 EDT 2014


https://github.com/krb5/krb5/commit/2b8692dad1be01ce0c57ca9d5e92b950c6aba155
commit 2b8692dad1be01ce0c57ca9d5e92b950c6aba155
Author: Greg Hudson <ghudson at mit.edu>
Date:   Wed May 28 11:36:24 2014 -0400

    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.

 src/lib/krb5/ccache/cc_keyring.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lib/krb5/ccache/cc_keyring.c b/src/lib/krb5/ccache/cc_keyring.c
index 63e49d2..43f33ee 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;


More information about the cvs-krb5 mailing list