diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-04-05 03:59:14 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-04-05 03:59:14 +0000 |
commit | 7b12819118d40eeb290318f11f0fedb9a1447f2f (patch) | |
tree | bc4fd61b0ce3175b4e5af67610c58bc4b94e23a3 /sys/kern | |
parent | a1735407e2b68faa347465d7c2d58671c8f7ba92 (diff) |
clear structure on the stack before copying out for sysctl. At present
it has no pads, but a future ABI change could add something and leak
kernel memory.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_clock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 106e41a5a31..310260a3b8c 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_clock.c,v 1.91 2016/09/04 09:22:29 mpi Exp $ */ +/* $OpenBSD: kern_clock.c,v 1.92 2017/04/05 03:59:13 deraadt Exp $ */ /* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */ /*- @@ -424,6 +424,7 @@ sysctl_clockrate(char *where, size_t *sizep, void *newp) /* * Construct clockinfo structure. */ + memset(&clkinfo, 0, sizeof clkinfo); clkinfo.tick = tick; clkinfo.tickadj = tickadj; clkinfo.hz = hz; |