krb5 commit [krb5-1.10]: Suppress some gcc uninitialized variable warnings

Tom Yu tlyu at MIT.EDU
Fri Jan 11 15:32:14 EST 2013


https://github.com/krb5/krb5/commit/6bd62ee3f6ef9c6fa215f302f73ea187aecbb9ff
commit 6bd62ee3f6ef9c6fa215f302f73ea187aecbb9ff
Author: Greg Hudson <ghudson at mit.edu>
Date:   Thu Mar 22 14:07:44 2012 +0000

    Suppress some gcc uninitialized variable warnings
    
    gcc 4.6.2 reportedly finds some spurious maybe-uninitialized warnings.
    Suppress them.  Patch from Eray Aslan with some adjustment.
    
    (cherry picked from commit cc2f16af06800bf9882c1589d3d6e9b8f19b6d6f)
    
    ticket: 7543 (new)
    version_fixed: 1.10.4
    status: resolved

 src/kdc/do_as_req.c           |    1 +
 src/lib/kadm5/srv/svr_iters.c |    2 +-
 src/slave/kprop.c             |    5 +++--
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/kdc/do_as_req.c b/src/kdc/do_as_req.c
index 8ada9d0..b9e1416 100644
--- a/src/kdc/do_as_req.c
+++ b/src/kdc/do_as_req.c
@@ -191,6 +191,7 @@ finish_process_as_req(struct as_req_state *state, krb5_error_code errcode)
      * by request keytype list.
      */
     client_key = NULL;
+    useenctype = 0;
     for (i = 0; i < state->request->nktypes; i++) {
         useenctype = state->request->ktype[i];
         if (!krb5_c_valid_enctype(useenctype))
diff --git a/src/lib/kadm5/srv/svr_iters.c b/src/lib/kadm5/srv/svr_iters.c
index b54dee3..d5a99de 100644
--- a/src/lib/kadm5/srv/svr_iters.c
+++ b/src/lib/kadm5/srv/svr_iters.c
@@ -187,7 +187,7 @@ static kadm5_ret_t kadm5_get_either(int princ,
 #ifdef BSD_REGEXPS
     char *msg;
 #endif
-    char *regexp;
+    char *regexp = NULL;
     int i, ret;
     kadm5_server_handle_t handle = server_handle;
 
diff --git a/src/slave/kprop.c b/src/slave/kprop.c
index 473f9f2..7f2bc00 100644
--- a/src/slave/kprop.c
+++ b/src/slave/kprop.c
@@ -310,7 +310,7 @@ void get_tickets(context)
 }
 
 static void
-open_connection(krb5_context context, char *host, int *fd)
+open_connection(krb5_context context, char *host, int *fd_out)
 {
     int     s;
     krb5_error_code retval;
@@ -320,6 +320,7 @@ open_connection(krb5_context context, char *host, int *fd)
     struct sockaddr_storage my_sin;
     int error;
 
+    *fd_out = -1;
     memset(&hints, 0, sizeof(hints));
     hints.ai_family = PF_UNSPEC;
     hints.ai_socktype = SOCK_STREAM;
@@ -347,7 +348,7 @@ open_connection(krb5_context context, char *host, int *fd)
         }
 
         /* We successfully connect()ed */
-        *fd = s;
+        *fd_out = s;
         retval = sockaddr2krbaddr(context, res->ai_family, res->ai_addr,
                                   &receiver_addr);
         if (retval != 0) {


More information about the cvs-krb5 mailing list