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

Commit8f4a369

Browse files
committed
Fix crash bug in RestoreSnapshot.
If serialized_snapshot->subxcnt > 0 and serialized_snapshot->xcnt == 0,the old coding would do the wrong thing and crash. This can happenon standby servers.Report by Andreas Seltenreich. Patch by Thomas Munro, reviewed byAmit Kapila and tested by Andreas Seltenreich.
1 parent8caf9fe commit8f4a369

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/utils/time/snapmgr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,8 @@ RestoreSnapshot(char *start_address)
15731573
/* Copy SubXIDs, if present. */
15741574
if (serialized_snapshot->subxcnt>0)
15751575
{
1576-
snapshot->subxip=snapshot->xip+serialized_snapshot->xcnt;
1576+
snapshot->subxip= ((TransactionId*) (snapshot+1))+
1577+
serialized_snapshot->xcnt;
15771578
memcpy(snapshot->subxip,serialized_xids+serialized_snapshot->xcnt,
15781579
serialized_snapshot->subxcnt*sizeof(TransactionId));
15791580
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp