summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2005-05-07 00:41:36 +0000
committercperciva <cperciva@FreeBSD.org>2005-05-07 00:41:36 +0000
commita199a4f74bc38eec1ed7dc4c056eccd38c08f535 (patch)
tree383a2f4d8c481fbc3d90a563cd17dcd85a7a396a /sys
parent6e0ff8ec55c9a636b0a1c3b1eedf2c263695a4ef (diff)
downloadFreeBSD-src-a199a4f74bc38eec1ed7dc4c056eccd38c08f535.zip
FreeBSD-src-a199a4f74bc38eec1ed7dc4c056eccd38c08f535.tar.gz
Fix two issues which were missed in FreeBSD-SA-05:08.kmem.
Reported by: Uwe Doering
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_usrreq.c2
-rw-r--r--sys/netinet/tcp_subr.c2
-rw-r--r--sys/netinet/tcp_timewait.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index dd91a96..0f50756 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 bde7f09..4e9038f 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 bde7f09..4e9038f 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);
OpenPOWER on IntegriCloud