summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2002-11-24 07:26:44 +0000
committerChad Loder <cloder@cvs.openbsd.org>2002-11-24 07:26:44 +0000
commit340596c6bdeda56634ffb651c1ede54ae600e2d5 (patch)
tree59b9ee4eb87e7dd0271075b23a51616942a146a9 /lib
parent6078f7737ef9b65bbace07fdead379b819e9437b (diff)
Zero out the reserved fields of struct gmonhdr rather than leaving
stack garbage in them. From FreeBSD. OK deraadt@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gmon/gmon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/gmon/gmon.c b/lib/libc/gmon/gmon.c
index abf1bab0936..8dee095bc83 100644
--- a/lib/libc/gmon/gmon.c
+++ b/lib/libc/gmon/gmon.c
@@ -32,7 +32,7 @@
*/
#if !defined(lint) && defined(LIBC_SCCS)
-static char rcsid[] = "$OpenBSD: gmon.c,v 1.13 2002/05/25 09:11:02 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: gmon.c,v 1.14 2002/11/24 07:26:43 cloder Exp $";
#endif
#include <sys/param.h>
@@ -228,6 +228,7 @@ _mcleanup()
write(log, dbuf, len);
#endif
hdr = (struct gmonhdr *)&gmonhdr;
+ bzero(hdr, sizeof(*hdr));
hdr->lpc = p->lowpc;
hdr->hpc = p->highpc;
hdr->ncnt = p->kcountsize + sizeof(gmonhdr);