postgres.git / summary / log / commit / refs
commit f73a31370624d7a67fc9c409df5be3da3778b462
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Tue Aug 07 20:00:44 2018 +0000
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
src/backend/postmaster/pgstat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index ea30d6f8f0d..77dbf4f92ff 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -2620,7 +2620,7 @@ CreateSharedBackendStatus(void)
if (!found)
{
- MemSet(BackendActivityBuffer, 0, size);
+ MemSet(BackendActivityBuffer, 0, BackendActivityBufferSize);
/* Initialize st_activity pointers. */
buffer = BackendActivityBuffer;
[parent: 92d5dd36ecf8]