From: Greg Hudson Date: Tue, 4 Oct 2011 22:40:10 +0000 (+0000) Subject: Fix initialization and pointer bugs in new code X-Git-Tag: krb5-1.10-alpha1~76 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=57a52177feee207d8b3f4bd0fbf7a3d7ee09c070;p=krb5.git Fix initialization and pointer bugs in new code Coverity found some minor-to-medium bugs in some recent changes; fix them. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25299 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kdc/do_as_req.c b/src/kdc/do_as_req.c index 7abbfac14..9102e26a0 100644 --- a/src/kdc/do_as_req.c +++ b/src/kdc/do_as_req.c @@ -131,7 +131,7 @@ finish_process_as_req(struct as_req_state *state, krb5_error_code errcode) krb5_key_data *server_key; krb5_key_data *client_key; krb5_keyblock *as_encrypting_key = NULL; - krb5_data *response; + krb5_data *response = NULL; const char *emsg = 0; int did_log = 0; register int i; @@ -468,6 +468,7 @@ process_as_req(krb5_kdc_req *request, krb5_data *req_pkt, state->request = request; state->e_data = NULL; state->authtime = 0; + state->c_flags = 0; state->req_pkt = req_pkt; state->rstate = NULL; state->sname = 0; diff --git a/src/lib/apputils/net-server.c b/src/lib/apputils/net-server.c index b31c6bc5c..11a7c122f 100644 --- a/src/lib/apputils/net-server.c +++ b/src/lib/apputils/net-server.c @@ -1548,7 +1548,7 @@ process_packet_response(void *arg, krb5_error_code code, krb5_data *response) if (code) com_err(state->prog ? state->prog : NULL, code, _("while dispatching (udp)")); - if (code || response == NULL || state == NULL) + if (code || response == NULL) goto out; cc = send_to_from(state->port_fd, response->data, @@ -1900,8 +1900,10 @@ process_tcp_connection_read(verto_ctx *ctx, verto_ev *ev) } state = prepare_for_dispatch(ctx, ev); - if (!state) + if (!state) { + krb5_free_data(get_context(conn->handle), response); goto kill_tcp_connection; + } process_tcp_response(state, 0, response); } }