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

Commiteb8c9f0

Browse files
committed
Fix use of dangling pointer in heap_delete() when logging replica identity
When logging the replica identity of a deleted tuple, XLOG_HEAP_DELETErecords include references of the old tuple. Its data is stored in anintermediate variable used to register this information for the WALrecord, but this variable gets away from the stack when the record getsactually inserted.Spotted by clang's AddressSanitizer.Author: Stas KelvishDiscussion:https://postgr.es/m/085C8825-AD86-4E93-AF80-E26CDF03D1EA@postgrespro.ruBackpatch-through: 9.4
1 parentf60a0e9 commiteb8c9f0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3039,6 +3039,7 @@ heap_delete(Relation relation, ItemPointer tid,
30393039
if (RelationNeedsWAL(relation))
30403040
{
30413041
xl_heap_deletexlrec;
3042+
xl_heap_headerxlhdr;
30423043
XLogRecPtrrecptr;
30433044

30443045
/* For logical decode we need combocids to properly decode the catalog */
@@ -3073,8 +3074,6 @@ heap_delete(Relation relation, ItemPointer tid,
30733074
*/
30743075
if (old_key_tuple!=NULL)
30753076
{
3076-
xl_heap_headerxlhdr;
3077-
30783077
xlhdr.t_infomask2=old_key_tuple->t_data->t_infomask2;
30793078
xlhdr.t_infomask=old_key_tuple->t_data->t_infomask;
30803079
xlhdr.t_hoff=old_key_tuple->t_data->t_hoff;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp