Skip to content

Commit 753051c

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 fb4e0e8 commit 753051c

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
@@ -2516,7 +2516,7 @@ CreateSharedBackendStatus(void)
25162516

25172517
if (!found)
25182518
{
2519-
MemSet(BackendActivityBuffer, 0, size);
2519+
MemSet(BackendActivityBuffer, 0, BackendActivityBufferSize);
25202520

25212521
/* Initialize st_activity pointers. */
25222522
buffer = BackendActivityBuffer;

0 commit comments

Comments
 (0)