krb5 commit [krb5-1.9]: Fix kdb5_util dump.c uninitialized warnings

Tom Yu tlyu at MIT.EDU
Tue Apr 23 17:19:27 EDT 2013


https://github.com/krb5/krb5/commit/5bad062b6e122354a5557d463f1e5e198374e0c9
commit 5bad062b6e122354a5557d463f1e5e198374e0c9
Author: Greg Hudson <ghudson at mit.edu>
Date:   Fri Feb 1 11:52:48 2013 -0500

    Fix kdb5_util dump.c uninitialized warnings
    
    Some versions of clang report an uninitialized variable warning (which
    we treat as an error) in process_k5beta_record.  Due to the if-ladder
    style of the function, uninitialized tmpint values can be copied
    around in certain error cases, although the garbage values would be
    ultimately ignored.  As a minimal fix, initialize the tmpint
    variables.
    
    (cherry picked from commit 1b7f7eef8a95bda0135159b2c06a168b56d9f42b)
    
    ticket: 7617 (new)
    version_fixed: 1.9.5
    status: resolved

 src/kadmin/dbutil/dump.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/kadmin/dbutil/dump.c b/src/kadmin/dbutil/dump.c
index 6d4e6bb..9c91024 100644
--- a/src/kadmin/dbutil/dump.c
+++ b/src/kadmin/dbutil/dump.c
@@ -1514,7 +1514,7 @@ process_k5beta_record(fname, kcontext, filep, flags, linenop)
     int                 alt_key_len, salt_len, alt_salt_len;
     char                *name;
     char                *mod_name;
-    int                 tmpint1, tmpint2, tmpint3;
+    int                 tmpint1 = 0, tmpint2 = 0, tmpint3 = 0;
     int                 error;
     const char          *try2read;
     int                 i;


More information about the cvs-krb5 mailing list