1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-25 21:42:33 +03:00

Fix SerializeSnapshot not to overrun the allocated space.

Rushabh Lathia
This commit is contained in:
Robert Haas 2016-03-04 13:47:05 -05:00
parent 0e7557dc8d
commit 17b124d303

View File

@ -1515,7 +1515,7 @@ SerializeSnapshot(Snapshot snapshot, char *start_address)
* snapshot taken during recovery; all the top-level XIDs are in subxip as * snapshot taken during recovery; all the top-level XIDs are in subxip as
* well in that case, so we mustn't lose them. * well in that case, so we mustn't lose them.
*/ */
if (snapshot->subxcnt > 0) if (serialized_snapshot->subxcnt > 0)
{ {
Size subxipoff = sizeof(SerializedSnapshotData) + Size subxipoff = sizeof(SerializedSnapshotData) +
snapshot->xcnt * sizeof(TransactionId); snapshot->xcnt * sizeof(TransactionId);