Skip to content

Commit ab441db

Browse files
knizhnikkelvich
authored andcommitted
Fix dangling pointer access
1 parent a4bddc7 commit ab441db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pglogical_apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ process_remote_commit(StringInfo in)
662662
case PGLOGICAL_PREPARE:
663663
{
664664
Assert(IsTransactionState() && TransactionIdIsValid(MtmGetCurrentTransactionId()));
665-
gid = pq_getmsgstring(in);
665+
gid = pstrdup(pq_getmsgstring(in)); /* in case of spilling large transaction to the file, message body will be deallocated, so copy it */
666666
if (MtmExchangeGlobalTransactionStatus(gid, TRANSACTION_STATUS_IN_PROGRESS) == TRANSACTION_STATUS_ABORTED) {
667667
MTM_LOG1("Avoid prepare of previously aborted global transaction %s", gid);
668668
AbortCurrentTransaction();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy