From 6f1ef95071c00f85df45132dd2c6cd0405835870 Mon Sep 17 00:00:00 2001 From: Abhijeet Patil Date: Thu, 11 Jan 2024 10:52:10 +0000 Subject: [PATCH] applied fix for PG16 sanitizers --- src/backend/access/transam/xlog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 0a6226892c9..3f20356de71 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -1281,7 +1281,8 @@ CopyXLogRecordToWAL(int write_len, bool isLogSwitch, XLogRecData *rdata, } Assert(CurrPos % XLOG_BLCKSZ >= SizeOfXLogShortPHD || rdata_len == 0); - memcpy(currpos, rdata_data, rdata_len); + if (rdata_len > 0) + memcpy(currpos, rdata_data, rdata_len); currpos += rdata_len; CurrPos += rdata_len; freespace -= rdata_len;