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

Commit ff03112

Browse files
committed
Fix off-by-one bug in XactLogCommitRecord
Commit 1eb6d65 introduced zeroed alignment bytes in the GID field of commit/abort WAL records. Fixup commit cf5a189 later changed that representation into a regular cstring with a single terminating zero byte, but it also introduced an off-by-one mistake. Fix that. Author: Nikhil Sontakke Reported-by: Nikhil Sontakke Discussion: https://postgr.es/m/CAMGcDxey6dG1DP34_tJMoWPcp5sPJUAL4K5CayUUXLQSx2GQpA@mail.gmail.com
1 parent dad8bed commit ff03112

File tree

1 file changed

+1
-1
lines changed
  • src/backend/access/transam

1 file changed

+1
-1
lines changed

src/backend/access/transam/xact.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5365,7 +5365,7 @@ XactLogCommitRecord(TimestampTz commit_time,
53655365
{
53665366
XLogRegisterData((char *) (&xl_twophase), sizeof(xl_xact_twophase));
53675367
if (xl_xinfo.xinfo & XACT_XINFO_HAS_GID)
5368-
XLogRegisterData((char *) twophase_gid, strlen(twophase_gid));
5368+
XLogRegisterData((char *) twophase_gid, strlen(twophase_gid) + 1);
53695369
}
53705370

53715371
if (xl_xinfo.xinfo & XACT_XINFO_HAS_ORIGIN)

0 commit comments

Comments
 (0)