* [PATCH] Cygwin: Zero out gmon header before use
@ 2021-06-23 8:56 Mark Geisert
2021-06-26 14:28 ` Jon Turney
0 siblings, 1 reply; 2+ messages in thread
From: Mark Geisert @ 2021-06-23 8:56 UTC (permalink / raw)
To: cygwin-patches
Tools that process gmon.out files can be confused by gmon header fields
with garbage in them due to lack of initialization. Repair that.
---
winsup/cygwin/gmon.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/winsup/cygwin/gmon.c b/winsup/cygwin/gmon.c
index b31842cd9..8b1c449c4 100644
--- a/winsup/cygwin/gmon.c
+++ b/winsup/cygwin/gmon.c
@@ -224,6 +224,7 @@ _mcleanup(void)
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);
--
2.31.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-26 14:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 8:56 [PATCH] Cygwin: Zero out gmon header before use Mark Geisert
2021-06-26 14:28 ` Jon Turney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).