From: Greg Hudson Date: Fri, 23 Jan 2009 06:51:03 +0000 (+0000) Subject: Add some output parameter initializations n order to eliminate some X-Git-Tag: krb5-1.7-alpha1~48 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=29e98730bfe3b7dfb72bead5577a928157ae5bca;p=krb5.git Add some output parameter initializations n order to eliminate some spurious Coverity defects. (Far from a comprehensive pass.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21782 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kdc/network.c b/src/kdc/network.c index fffaa1e78..4ebaf2b32 100644 --- a/src/kdc/network.c +++ b/src/kdc/network.c @@ -1163,6 +1163,7 @@ make_too_big_error (krb5_data **out) krb5_error_code retval; krb5_data *scratch; + *out = NULL; memset(&errpkt, 0, sizeof(errpkt)); retval = krb5_us_timeofday(kdc_context, &errpkt.stime, &errpkt.susec); diff --git a/src/lib/kadm5/srv/svr_iters.c b/src/lib/kadm5/srv/svr_iters.c index 9774d76ea..cd3fb4177 100644 --- a/src/lib/kadm5/srv/svr_iters.c +++ b/src/lib/kadm5/srv/svr_iters.c @@ -192,7 +192,8 @@ static kadm5_ret_t kadm5_get_either(int princ, char *regexp; int i, ret; kadm5_server_handle_t handle = server_handle; - + + *princs = NULL; *count = 0; if (exp == NULL) exp = "*"; diff --git a/src/lib/kdb/kdb5.c b/src/lib/kdb/kdb5.c index e76ebe921..5cc67f9b3 100644 --- a/src/lib/kdb/kdb5.c +++ b/src/lib/kdb/kdb5.c @@ -1861,6 +1861,9 @@ krb5_dbe_lookup_mod_princ_data(context, entry, mod_time, mod_princ) krb5_tl_data tl_data; krb5_error_code code; + *mod_princ = NULL; + *mod_time = 0; + tl_data.tl_data_type = KRB5_TL_MOD_PRINC; if ((code = krb5_dbe_lookup_tl_data(context, entry, &tl_data))) diff --git a/src/lib/krb5/os/read_msg.c b/src/lib/krb5/os/read_msg.c index 77cda8032..47973bbd8 100644 --- a/src/lib/krb5/os/read_msg.c +++ b/src/lib/krb5/os/read_msg.c @@ -37,7 +37,10 @@ krb5_read_message(krb5_context context, krb5_pointer fdp, krb5_data *inbuf) int len2, ilen; char *buf = NULL; int fd = *( (int *) fdp); - + + inbuf->data = NULL; + inbuf->length = 0; + if ((len2 = krb5_net_read(context, fd, (char *)&len, 4)) != 4) return((len2 < 0) ? errno : ECONNABORTED); len = ntohl(len); diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c index 15bbbb85c..c402e2ee1 100644 --- a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c +++ b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c @@ -2259,6 +2259,9 @@ server_process_dh(krb5_context context, unsigned char *p = NULL; ASN1_INTEGER *pub_key = NULL; + *dh_pubkey = *server_key = NULL; + *dh_pubkey_len = *server_key_len = 0; + /* get client's received DH parameters that we saved in server_check_dh */ dh = cryptoctx->dh;