Skip to content

Commit f73a313

Browse files
committed
Fix incorrect initialization of BackendActivityBuffer.
Since commit c8e8b5a, 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
1 parent 92d5dd3 commit f73a313

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/postmaster/pgstat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2620,7 +2620,7 @@ CreateSharedBackendStatus(void)
26202620

26212621
if (!found)
26222622
{
2623-
MemSet(BackendActivityBuffer, 0, size);
2623+
MemSet(BackendActivityBuffer, 0, BackendActivityBufferSize);
26242624

26252625
/* Initialize st_activity pointers. */
26262626
buffer = BackendActivityBuffer;

0 commit comments

Comments
 (0)