pgsql: Fix use of dangling pointer in heap_delete() when logging replic

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix use of dangling pointer in heap_delete() when logging replic
Date: 2019-02-01 01:38:26
Message-ID: E1gpNmk-00028m-RC@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix use of dangling pointer in heap_delete() when logging replica identity

When logging the replica identity of a deleted tuple, XLOG_HEAP_DELETE
records include references of the old tuple. Its data is stored in an
intermediate variable used to register this information for the WAL
record, but this variable gets away from the stack when the record gets
actually inserted.

Spotted by clang's AddressSanitizer.

Author: Stas Kelvish
Discussion: https://postgr.es/m/085C8825-AD86-4E93-AF80-E26CDF03D1EA@postgrespro.ru
Backpatch-through: 9.4

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/90f1ba7ecf01f063c0e113c72afcf8c1a64ca285

Modified Files
--------------
src/backend/access/heap/heapam.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2019-02-01 01:48:42 pgsql: Adjust comment about timeout when waiting for WAL at recovery
Previous Message Peter Eisentraut 2019-01-31 23:46:30 pgsql: Add more columns to pg_stat_ssl