Commit 1687dca1 authored by Pekka Pessi's avatar Pekka Pessi

tport.c: do not use out-of-scope array in tport_deliver()

Ignore-this: a651d5eb213850d9dfd317102a432f8e

Coverity issue.

darcs-hash:20090512182333-db55f-dc6aba55d33b314bcfc4fafbb7658132cc979910.gz
parent bca71a5c
......@@ -2952,6 +2952,7 @@ void tport_deliver(tport_t *self,
tport_t *ref;
int error;
struct tport_delivery *d;
char ipaddr[SU_ADDRSIZE + 2];
assert(msg);
......@@ -2962,7 +2963,6 @@ void tport_deliver(tport_t *self,
*d->d_from = *self->tp_name;
if (tport_is_primary(self)) {
char ipaddr[SU_ADDRSIZE + 2];
su_sockaddr_t const *su = msg_addr(msg);
#if SU_HAVE_IN6
......@@ -3005,16 +3005,16 @@ void tport_deliver(tport_t *self,
ref = tport_incref(self);
if (self->tp_pri->pri_vtable->vtp_deliver) {
self->tp_pri->pri_vtable->vtp_deliver(self, msg, now);
}
else
tport_base_deliver(self, msg, now);
tport_decref(&ref);
memset(d->d_from, 0, sizeof d->d_from);
d->d_msg = NULL;
tport_decref(&ref);
}
/** Pass message to the protocol stack */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment