diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index dd91a9672792..0f507564ac6e 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 bde7f095f26c..4e9038fd6a2f 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 bde7f095f26c..4e9038fd6a2f 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);