Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9ed87a7

Browse files
committed
Fix read beyond buffer bug introduced by the split xlog.c patch.
FinishWalRecovery() copied the valid part of the last WAL block into apalloc'd buffer, and the code in StartupXLOG() copied it to the WALbuffer. But the memcpy in StartupXLOG() copied a full 8kB block, notjust the valid part, i.e. it copied from beyond the end of the buffer.The invalid part was cleared immediately afterwards, so as long as thememory was allocated and didn't segfault, it didn't do any harm, butit can definitely segfault.Discussion:https://www.postgresql.org/message-id/efc12e32-5af2-3485-5b1d-5af9f707491a@iki.fi
1 parent2549f06 commit9ed87a7

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5454,7 +5454,7 @@ StartupXLOG(void)
54545454

54555455
/* Copy the valid part of the last block, and zero the rest */
54565456
page=&XLogCtl->pages[firstIdx*XLOG_BLCKSZ];
5457-
memcpy(page,endOfRecoveryInfo->lastPage,XLOG_BLCKSZ);
5457+
memcpy(page,endOfRecoveryInfo->lastPage,len);
54585458
memset(page+len,0,XLOG_BLCKSZ-len);
54595459

54605460
XLogCtl->xlblocks[firstIdx]=endOfRecoveryInfo->lastPageBeginPtr+XLOG_BLCKSZ;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp