0001-Fix-terminating-condition-while-fetching-the-replica.patch
application/octet-stream
Filename: 0001-Fix-terminating-condition-while-fetching-the-replica.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch 0001
Subject: Fix terminating condition while fetching the replication worker status
| File | + | − |
|---|---|---|
| src/backend/replication/logical/launcher.c | 1 | 1 |
From f8efb6e98bd99e544542e0060d621109ef2bdefb Mon Sep 17 00:00:00 2001
From: Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Date: Tue, 7 Jun 2022 22:24:55 +0530
Subject: [PATCH] Fix terminating condition while fetching the replication
worker status
While fetching the replication worker status in
pg_stat_get_subscription, we're accessing invalid memory resulting to
random crash.
---
src/backend/replication/logical/launcher.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/replication/logical/launcher.c b/src/backend/replication/logical/launcher.c
index bd5f78cf9a..2bdab53e19 100644
--- a/src/backend/replication/logical/launcher.c
+++ b/src/backend/replication/logical/launcher.c
@@ -935,7 +935,7 @@ pg_stat_get_subscription(PG_FUNCTION_ARGS)
/* Make sure we get consistent view of the workers. */
LWLockAcquire(LogicalRepWorkerLock, LW_SHARED);
- for (i = 0; i <= max_logical_replication_workers; i++)
+ for (i = 0; i < max_logical_replication_workers; i++)
{
/* for each row */
Datum values[PG_STAT_GET_SUBSCRIPTION_COLS];
--
2.27.0