Fix SerializeSnapshot not to overrun the allocated space.
authorRobert Haas
Fri, 4 Mar 2016 18:47:05 +0000 (13:47 -0500)
committerRobert Haas
Fri, 4 Mar 2016 19:00:22 +0000 (14:00 -0500)
Rushabh Lathia

src/backend/utils/time/snapmgr.c

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