]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix kdb5_util dump.c uninitialized warnings
authorGreg Hudson <ghudson@mit.edu>
Fri, 1 Feb 2013 16:52:48 +0000 (11:52 -0500)
committerGreg Hudson <ghudson@mit.edu>
Fri, 1 Feb 2013 16:53:38 +0000 (11:53 -0500)
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.

ticket: 7560 (new)
target_version: 1.11.1
tags: pullup

src/kadmin/dbutil/dump.c

index 869724af680569b3846def9d9fd59b0ece5431d3..66a72be9b555df570d9e144f15be80fa15c0c081 100644 (file)
@@ -1707,7 +1707,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;