-/* $OpenBSD: if_pfsync.c,v 1.246 2017/03/11 13:21:16 stsp Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.247 2017/04/05 13:35:18 deraadt Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
struct pfsyncstats pfsyncstat;
CTASSERT(sizeof(pfsyncstat) == (pfsyncs_ncounters * sizeof(uint64_t)));
+ memset(&pfsyncstat, 0, sizeof pfsyncstat);
counters_read(pfsynccounters, (uint64_t *)&pfsyncstat,
pfsyncs_ncounters);
return (sysctl_rdstruct(oldp, oldlenp, newp,
-/* $OpenBSD: rtsock.c,v 1.235 2017/03/16 10:13:11 mpi Exp $ */
+/* $OpenBSD: rtsock.c,v 1.236 2017/04/05 13:35:18 deraadt Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
tableid = w.w_arg;
if (!rtable_exists(tableid))
return (ENOENT);
+ memset(&tableinfo, 0, sizeof tableinfo);
tableinfo.rti_tableid = tableid;
tableinfo.rti_domainid = rtable_l2(tableid);
error = sysctl_rdstruct(where, given, new,
int i;
CTASSERT(sizeof(rtstat) == (nitems(counters) * sizeof(uint32_t)));
-
+ memset(&rtstat, 0, sizeof rtstat);
counters_read(rtcounters, counters, nitems(counters));
for (i = 0; i < nitems(counters); i++)
-/* $OpenBSD: igmp.c,v 1.64 2017/02/05 16:23:38 jca Exp $ */
+/* $OpenBSD: igmp.c,v 1.65 2017/04/05 13:35:18 deraadt Exp $ */
/* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */
/*
int i;
CTASSERT(sizeof(igmpstat) == (nitems(counters) * sizeof(u_long)));
-
+ memset(&igmpstat, 0, sizeof igmpstat);
counters_read(igmpcounters, counters, nitems(counters));
for (i = 0; i < nitems(counters); i++)
-/* $OpenBSD: ip_carp.c,v 1.304 2017/03/23 14:12:46 bluhm Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.305 2017/04/05 13:35:18 deraadt Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
struct carpstats carpstat;
CTASSERT(sizeof(carpstat) == (carps_ncounters * sizeof(uint64_t)));
+ memset(&carpstat, 0, sizeof carpstat);
counters_read(carpcounters, (uint64_t *)&carpstat, carps_ncounters);
return (sysctl_rdstruct(oldp, oldlenp, newp,
&carpstat, sizeof(carpstat)));
-/* $OpenBSD: ip_divert.c,v 1.45 2017/03/13 20:18:21 claudio Exp $ */
+/* $OpenBSD: ip_divert.c,v 1.46 2017/04/05 13:35:18 deraadt Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
int i;
CTASSERT(sizeof(divstat) == (nitems(counters) * sizeof(u_long)));
-
+ memset(&divstat, 0, sizeof divstat);
counters_read(divcounters, counters, nitems(counters));
for (i = 0; i < nitems(counters); i++)
-/* $OpenBSD: ip_icmp.c,v 1.163 2017/02/07 22:30:16 jmatthew Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.164 2017/04/05 13:35:18 deraadt Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
int i;
CTASSERT(sizeof(icmpstat) == (nitems(counters) * sizeof(u_long)));
-
+ memset(&icmpstat, 0, sizeof icmpstat);
counters_read(icmpcounters, counters, nitems(counters));
for (i = 0; i < nitems(counters); i++)
-/* $OpenBSD: ip_input.c,v 1.295 2017/02/05 16:23:38 jca Exp $ */
+/* $OpenBSD: ip_input.c,v 1.296 2017/04/05 13:35:18 deraadt Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
int i;
CTASSERT(sizeof(ipstat) == (nitems(counters) * sizeof(u_long)));
-
+ memset(&ipstat, 0, sizeof ipstat);
counters_read(ipcounters, counters, nitems(counters));
for (i = 0; i < nitems(counters); i++)
-/* $OpenBSD: ip_ipip.c,v 1.72 2017/03/10 07:29:25 jca Exp $ */
+/* $OpenBSD: ip_ipip.c,v 1.73 2017/04/05 13:35:18 deraadt Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
struct ipipstat ipipstat;
CTASSERT(sizeof(ipipstat) == (ipips_ncounters * sizeof(uint64_t)));
+ memset(&ipipstat, 0, sizeof ipipstat);
counters_read(ipipcounters, (uint64_t *)&ipipstat, ipips_ncounters);
return (sysctl_rdstruct(oldp, oldlenp, newp,
&ipipstat, sizeof(ipipstat)));
-/* $OpenBSD: tcp_usrreq.c,v 1.146 2017/04/02 12:56:39 jca Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.147 2017/04/05 13:35:18 deraadt Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
#define ASSIGN(field) do { tcpstat.field = counters[i++]; } while (0)
+ memset(&tcpstat, 0, sizeof tcpstat);
counters_read(tcpcounters, counters, nitems(counters));
ASSIGN(tcps_connattempt);
ASSIGN(tcps_accepts);
-/* $OpenBSD: udp_usrreq.c,v 1.232 2017/03/13 20:18:21 claudio Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.233 2017/04/05 13:35:18 deraadt Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
int i;
CTASSERT(sizeof(udpstat) == (nitems(counters) * sizeof(u_long)));
-
+ memset(&udpstat, 0, sizeof udpstat);
counters_read(udpcounters, counters, nitems(counters));
for (i = 0; i < nitems(counters); i++)
-/* $OpenBSD: icmp6.c,v 1.203 2017/03/03 13:19:40 bluhm Exp $ */
+/* $OpenBSD: icmp6.c,v 1.204 2017/04/05 13:35:18 deraadt Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
int ret;
CTASSERT(sizeof(*icmp6stat) == icp6s_ncounters * sizeof(uint64_t));
- icmp6stat = malloc(sizeof(*icmp6stat), M_TEMP, M_WAITOK);
+ icmp6stat = malloc(sizeof(*icmp6stat), M_TEMP, M_WAITOK|M_ZERO);
counters_read(icmp6counters, (uint64_t *)icmp6stat, icp6s_ncounters);
ret = sysctl_rdstruct(oldp, oldlenp, newp,
icmp6stat, sizeof(*icmp6stat));