]> granicus.if.org Git - postgresql/commitdiff
Fix SerializeSnapshot not to overrun the allocated space.
authorRobert Haas <rhaas@postgresql.org>
Fri, 4 Mar 2016 18:47:05 +0000 (13:47 -0500)
committerRobert Haas <rhaas@postgresql.org>
Fri, 4 Mar 2016 18:48:36 +0000 (13:48 -0500)
Rushabh Lathia

src/backend/utils/time/snapmgr.c

index 63e908d0a000aad77101e1ba849b055d5c997749..b88e01200419b114309f01ab7dd8ab4e5c9cc3b3 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);