Skip to content

Commit 2947fb7

Browse files
alexanderlawlubennikovaav
authored andcommitted
Avoid runtime failure in CopyXLogRecordToWAL with sanitizers (cf. 46ab07f) (#554)
1 parent d8d025b commit 2947fb7

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
@@ -1348,7 +1348,8 @@ CopyXLogRecordToWAL(int write_len, bool isLogSwitch, XLogRecData *rdata,
13481348
}
13491349

13501350
Assert(CurrPos % XLOG_BLCKSZ >= SizeOfXLogShortPHD || rdata_len == 0);
1351-
memcpy(currpos, rdata_data, rdata_len);
1351+
if (rdata_len > 0)
1352+
memcpy(currpos, rdata_data, rdata_len);
13521353
currpos += rdata_len;
13531354
CurrPos += rdata_len;
13541355
freespace -= rdata_len;

0 commit comments

Comments
 (0)