arrfab / rpms / glibc

Forked from rpms/glibc 4 years ago
Clone

Blame SOURCES/glibc-rh1505492-uninit-1.patch

147e83
commit 6ee3eab42979fdd5bb971a40fec32e04bb9dd2ad
147e83
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
147e83
Date:   Wed Jul 9 10:36:50 2014 +0530
147e83
147e83
    Fix -Wmaybe-uninitialized warning in xdr.c
147e83
    
147e83
    While we're at fixing build warnings, here's one unnecessary warning
147e83
    that can be fixed fairly easily.  The SIZE variable is never actually
147e83
    use uninitialized, but the compiler cannot make that out and thinks
147e83
    (correctly) that there is a potential for accessing SIZE without
147e83
    initializing it.  Make this safe by initializing SIZE to 0.
147e83
    
147e83
    Tested on x86_64.
147e83
147e83
diff --git a/sunrpc/xdr.c b/sunrpc/xdr.c
147e83
index 7eac2d40f036aa70..b3e713cbc9c3e012 100644
147e83
--- a/sunrpc/xdr.c
147e83
+++ b/sunrpc/xdr.c
147e83
@@ -738,7 +738,7 @@ xdr_string (xdrs, cpp, maxsize)
147e83
      u_int maxsize;
147e83
 {
147e83
   char *sp = *cpp;	/* sp is the actual string pointer */
147e83
-  u_int size;
147e83
+  u_int size = 0;
147e83
   u_int nodesize;
147e83
 
147e83
   /*