Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 292b9c0

Browse files
committed
fix unaligned access in ParseCommitRecord
1 parent ce1941f commit 292b9c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/access/rmgrdesc/xactdesc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ ParseCommitRecord(uint8 info, xl_xact_commit *xlrec, xl_xact_parsed_commit *pars
9797

9898
if (parsed->xinfo & XACT_XINFO_HAS_TWOPHASE)
9999
{
100-
xl_xact_twophase *xl_twophase = (xl_xact_twophase *) data;
101-
102-
parsed->twophase_xid = xl_twophase->xid;
100+
xl_xact_twophase xl_twophase;
103101

102+
memcpy(&xl_twophase, data, sizeof(xl_twophase));
103+
parsed->twophase_xid = xl_twophase.xid;
104104
data += sizeof(xl_xact_twophase);
105105

106106
if (parsed->xinfo & XACT_XINFO_HAS_GID)

0 commit comments

Comments
 (0)