summaryrefslogtreecommitdiff
path: root/sys/net/if_pfsync.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-04-05 13:35:19 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-04-05 13:35:19 +0000
commitca16eb74a9c45a8f1bcdf5ca4d1e3cc9c2ea7854 (patch)
tree7287871498c7e722bdba23008440c0e70ffb7b39 /sys/net/if_pfsync.c
parentf9bbb7cc5a06997baa3bc226b06b0dbe1494a0b6 (diff)
When building counter memory in preparation to copy to userland, always
zero the buffers first. All the current objects appear to be safe, however future changes might introduce structure pads. Discussed with guenther, ok bluhm
Diffstat (limited to 'sys/net/if_pfsync.c')
-rw-r--r--sys/net/if_pfsync.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index aa53c5c8b05..80f3787e4a4 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $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
@@ -2384,6 +2384,7 @@ pfsync_sysctl_pfsyncstat(void *oldp, size_t *oldlenp, void *newp)
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,