summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcloder <cloder@openbsd.org>2002-11-24 07:26:43 +0000
committercloder <cloder@openbsd.org>2002-11-24 07:26:43 +0000
commit672e980c7a5c20d9e02f8a7fffb4452846179356 (patch)
tree6e3592fdfeedcd2056b0f2676a4b059b8f4d2b2e
parentMake this compile again if FDC_C_HANDLER is defined. (diff)
downloadwireguard-openbsd-672e980c7a5c20d9e02f8a7fffb4452846179356.tar.xz
wireguard-openbsd-672e980c7a5c20d9e02f8a7fffb4452846179356.zip
Zero out the reserved fields of struct gmonhdr rather than leaving
stack garbage in them. From FreeBSD. OK deraadt@
-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);