Skip to content

Commit d2fc3db

Browse files
alexanderlawMMeent
authored andcommitted
Avoid runtime failure in CopyXLogRecordToWAL with sanitizers (cf. 46ab07f) (#554)
1 parent 804a0c1 commit d2fc3db

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

src/backend/access/transam/xlog.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,8 @@ CopyXLogRecordToWAL(int write_len, bool isLogSwitch, XLogRecData *rdata,
13321332
}
13331333

13341334
Assert(CurrPos % XLOG_BLCKSZ >= SizeOfXLogShortPHD || rdata_len == 0);
1335-
memcpy(currpos, rdata_data, rdata_len);
1335+
if (rdata_len > 0)
1336+
memcpy(currpos, rdata_data, rdata_len);
13361337
currpos += rdata_len;
13371338
CurrPos += rdata_len;
13381339
freespace -= rdata_len;

0 commit comments

Comments
 (0)