aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-08-07 16:00:44 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-08-07 16:00:59 -0400
commit8dd07458149a951a2d40bd4d0061ca33cbf61860 (patch)
tree7f2481d1dbd7eac1527035ea10a17112365b4c57
parentc9dacdb1c9428c2a021ee4d0a444147f8fcf07ef (diff)
downloadpostgresql-8dd07458149a951a2d40bd4d0061ca33cbf61860.tar.gz
postgresql-8dd07458149a951a2d40bd4d0061ca33cbf61860.zip
Fix incorrect initialization of BackendActivityBuffer.
Since commit c8e8b5a6e, this has been zeroed out using the wrong length. In practice the length would always be too small, leading to not zeroing the whole buffer rather than clobbering additional memory; and that's pretty harmless, both because shmem would likely start out as zeroes and because we'd reinitialize any given entry before use. Still, it's bogus, so fix it. Reported by Petru-Florin Mihancea (bug #15312) Discussion: https://postgr.es/m/153363913073.1303.6518849192351268091@wrigleys.postgresql.org
-rw-r--r--src/backend/postmaster/pgstat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index a121e7fdcd3..50960f738e4 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -2695,7 +2695,7 @@ CreateSharedBackendStatus(void)
if (!found)
{
- MemSet(BackendActivityBuffer, 0, size);
+ MemSet(BackendActivityBuffer, 0, BackendActivityBufferSize);
/* Initialize st_activity pointers. */
buffer = BackendActivityBuffer;