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

Commited6329c

Browse files
committed
Avoid memcpy() with same source and destination in pgstat_recv_replslot.
Same type of issue as in commit53d4f5f and earlier fixes; alsofound by apparently-more-picky-than-the-buildfarm valgrind testing.This one is an oversight in commit9868167. Since that's new inHEAD, no need for a back-patch.
1 parent11072e8 commited6329c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/backend/postmaster/pgstat.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6916,15 +6916,15 @@ pgstat_recv_replslot(PgStat_MsgReplSlot *msg, int len)
69166916
return;
69176917

69186918
/* it must be a valid replication slot index */
6919-
Assert(idx>=0&&idx<max_replication_slots);
6919+
Assert(idx<nReplSlotStats);
69206920

69216921
if (msg->m_drop)
69226922
{
69236923
/* Remove the replication slot statistics with the given name */
6924-
memcpy(&replSlotStats[idx],&replSlotStats[nReplSlotStats-1],
6925-
sizeof(PgStat_ReplSlotStats));
6924+
if (idx<nReplSlotStats-1)
6925+
memcpy(&replSlotStats[idx],&replSlotStats[nReplSlotStats-1],
6926+
sizeof(PgStat_ReplSlotStats));
69266927
nReplSlotStats--;
6927-
Assert(nReplSlotStats >=0);
69286928
}
69296929
else
69306930
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp