mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-05 01:30:43 +00:00
Fix two issues which were missed in FreeBSD-SA-05:08.kmem.
Reported by: Uwe Doering
This commit is contained in:
parent
ff23585421
commit
fe2eee8231
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=145978
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user