artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
13f0bae
)
sysctl(2): KERN_CPUSTATS: zero struct cpustats before copyout
author
cheloha
<cheloha@openbsd.org>
Sat, 14 Jan 2023 01:04:55 +0000
(
01:04
+0000)
committer
cheloha
<cheloha@openbsd.org>
Sat, 14 Jan 2023 01:04:55 +0000
(
01:04
+0000)
sys/kern/kern_sysctl.c
patch
|
blob
|
history
diff --git
a/sys/kern/kern_sysctl.c
b/sys/kern/kern_sysctl.c
index
ff42ebb
..
7bd6576
100644
(file)
--- a/
sys/kern/kern_sysctl.c
+++ b/
sys/kern/kern_sysctl.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: kern_sysctl.c,v 1.40
8 2022/11/07 14:25:44 robert Exp $
*/
+/* $OpenBSD: kern_sysctl.c,v 1.40
9 2023/01/14 01:04:55 cheloha Exp $
*/
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@
-2510,6
+2510,7
@@
sysctl_cpustats(int *name, u_int namelen, void *oldp, size_t *oldlenp,
if (!found)
return (ENOENT);
+ memset(&cs, 0, sizeof cs);
memcpy(&cs.cs_time, &ci->ci_schedstate.spc_cp_time, sizeof(cs.cs_time));
cs.cs_flags = 0;
if (cpu_is_online(ci))