Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbf4717b

Browse files
committed
Fix off-by-one loop termination condition in pg_stat_get_subscription().
pg_stat_get_subscription scanned one more LogicalRepWorker array entrythan is really allocated. In the worst case this could lead to SIGSEGV,if the LogicalRepCtx data structure is near the end of shared memory.That seems quite unlikely though (thanks to the ordering of calls inCreateSharedMemoryAndSemaphores) and we've heard no field reports of it.A more likely misbehavior is one row of garbage data in the function'sresult, but even that is not real likely because of the check that thepid field matches some live backend.Report and fix by Kuntal Ghosh. This bug is old, so back-patchto all supported branches.Discussion:https://postgr.es/m/CAGz5QCJykEDzW6jQK6Yz7Qh_PMtD=95de_7QoocbVR2Qy8hWZA@mail.gmail.com
1 parent51da231 commitbf4717b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/replication/logical/launcher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ pg_stat_get_subscription(PG_FUNCTION_ARGS)
935935
/* Make sure we get consistent view of the workers. */
936936
LWLockAcquire(LogicalRepWorkerLock,LW_SHARED);
937937

938-
for (i=0;i <=max_logical_replication_workers;i++)
938+
for (i=0;i<max_logical_replication_workers;i++)
939939
{
940940
/* for each row */
941941
Datumvalues[PG_STAT_GET_SUBSCRIPTION_COLS];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp