From fe2eee8231bddaae179df741f7df389a96e7afef Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Sat, 7 May 2005 00:41:36 +0000 Subject: [PATCH] Fix two issues which were missed in FreeBSD-SA-05:08.kmem. Reported by: Uwe Doering --- sys/kern/uipc_usrreq.c | 2 +- sys/netinet/tcp_subr.c | 2 ++ sys/netinet/tcp_timewait.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index dd91a967279..0f507564ac6 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1175,7 +1175,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) n = i; /* in case we lost some during malloc */ error = 0; - xu = malloc(sizeof(*xu), M_TEMP, M_WAITOK); + xu = malloc(sizeof(*xu), M_TEMP, M_WAITOK | M_ZERO); for (i = 0; i < n; i++) { unp = unp_list[i]; if (unp->unp_gencnt <= gencnt) { diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index bde7f095f26..4e9038fd6a2 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -941,6 +941,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (inp->inp_gencnt <= gencnt) { struct xtcpcb xt; caddr_t inp_ppcb; + + bzero(&xt, sizeof(xt)); xt.xt_len = sizeof xt; /* XXX should avoid extra copy */ bcopy(inp, &xt.xt_inp, sizeof *inp); diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index bde7f095f26..4e9038fd6a2 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -941,6 +941,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (inp->inp_gencnt <= gencnt) { struct xtcpcb xt; caddr_t inp_ppcb; + + bzero(&xt, sizeof(xt)); xt.xt_len = sizeof xt; /* XXX should avoid extra copy */ bcopy(inp, &xt.xt_inp, sizeof *inp);