From: Greg Hudson Date: Thu, 22 Mar 2012 14:07:44 +0000 (+0000) Subject: Suppress some gcc uninitialized variable warnings X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cc2f16af06800bf9882c1589d3d6e9b8f19b6d6f;p=krb5.git Suppress some gcc uninitialized variable warnings ticket: 7107 gcc 4.6.2 reportedly finds some spurious maybe-uninitialized warnings. Suppress them. Patch from Eray Aslan with some adjustment. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25783 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kdc/do_as_req.c b/src/kdc/do_as_req.c index 4651b7278..9234924b9 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 b54dee32d..d5a99dea0 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 473f9f23a..7f2bc00d6 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) {