Fix two issues which were missed in FreeBSD-SA-05:08.kmem.

Reported by:	Uwe Doering
This commit is contained in:
Colin Percival 2005-05-07 00:41:36 +00:00
parent ff23585421
commit fe2eee8231
3 changed files with 5 additions and 1 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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);