]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix build with -O3 on ppc64el
authorBen Kaduk <kaduk@mit.edu>
Thu, 11 Aug 2016 04:25:47 +0000 (23:25 -0500)
committerTom Yu <tlyu@mit.edu>
Fri, 9 Sep 2016 21:10:23 +0000 (17:10 -0400)
Ubuntu runs ppc64el builds with -O3, which elicited a few warnings
from gcc that were not generated elsewhere, as documented at
https://bugs.launchpad.net/ubuntu/+source/krb5/+bug/1592841 .

Initialize the output variable at the top of a couple of helper functions
to silence the uninitialized-variable warnings.

(cherry picked from commit 7db89952d8d4f806ac8b4908f898ac651df11643)

ticket: 8475
version_fixed: 1.13.7

src/lib/krb5/os/sendto_kdc.c
src/tests/asn.1/trval.c

index 9c54d9948e5c7c840ad528022102963ed11e5e1d..705e4a9dcf8cfccc8f1ba883d51805c40ce0692c 100644 (file)
@@ -171,6 +171,8 @@ get_curtime_ms(time_ms *time_out)
 {
     struct timeval tv;
 
+    *time_out = 0;
+
     if (gettimeofday(&tv, 0))
         return errno;
     *time_out = (time_ms)tv.tv_sec * 1000 + tv.tv_usec / 1000;
index e924fd8aa1ab1f3ab565afdc965a3d6a49150423..c14bcdeb69b1cc2f2a55d48c683da5aa4c39c572 100644 (file)
@@ -180,6 +180,7 @@ int trval2(fp, enc, len, lev, rlen)
     int rlen_ext = 0;
 
     r = OK;
+    *rlen = -1;
 
     if (len < 2) {
         fprintf(fp, "missing id and length octets (%d)\n", len);