diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-06-15 15:00:41 -0400 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-06-15 15:00:41 -0400 |
commit | ff03112bdc70541382b39fa4e36b9a9ad93b4b73 (patch) | |
tree | 96b9a190f52fc720c13971c8eb650dcb8ce56f24 /src | |
parent | dad8bed04ab98ada84ecd58ace6f59839aa161c4 (diff) | |
download | postgresql-ff03112bdc70541382b39fa4e36b9a9ad93b4b73.tar.gz postgresql-ff03112bdc70541382b39fa4e36b9a9ad93b4b73.zip |
Fix off-by-one bug in XactLogCommitRecord
Commit 1eb6d6527aae introduced zeroed alignment bytes in the GID field
of commit/abort WAL records. Fixup commit cf5a1890592b 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
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/transam/xact.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index f4e5ea84b99..b51eeb087e8 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -5365,7 +5365,7 @@ XactLogCommitRecord(TimestampTz commit_time, { XLogRegisterData((char *) (&xl_twophase), sizeof(xl_xact_twophase)); if (xl_xinfo.xinfo & XACT_XINFO_HAS_GID) - XLogRegisterData((char *) twophase_gid, strlen(twophase_gid)); + XLogRegisterData((char *) twophase_gid, strlen(twophase_gid) + 1); } if (xl_xinfo.xinfo & XACT_XINFO_HAS_ORIGIN) |