diff options
author | Mark Geisert <mark@maxrnd.com> | 2021-06-23 01:56:14 -0700 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2021-06-26 15:24:27 +0100 |
commit | 5c9c31c52bfbf41e903eff136cdf894572704e31 (patch) | |
tree | 861c95d22becc24630c17cb31f3c6500603087ff /winsup/cygwin/gmon.c | |
parent | a39ae40b86d3d4acb7d360d6d18b09ebf4e98fcd (diff) | |
download | newlib-5c9c31c52bfbf41e903eff136cdf894572704e31.zip newlib-5c9c31c52bfbf41e903eff136cdf894572704e31.tar.gz newlib-5c9c31c52bfbf41e903eff136cdf894572704e31.tar.bz2 |
Cygwin: Zero out gmon header before use
Tools that process gmon.out files can be confused by gmon header fields
with garbage in them due to lack of initialization. Repair that.
Diffstat (limited to 'winsup/cygwin/gmon.c')
-rw-r--r-- | winsup/cygwin/gmon.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/winsup/cygwin/gmon.c b/winsup/cygwin/gmon.c index b31842c..8b1c449 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); |