]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix use of dangling pointer in heap_delete() when logging replica identity
authorMichael Paquier <michael@paquier.xyz>
Fri, 1 Feb 2019 01:35:40 +0000 (10:35 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 1 Feb 2019 01:35:40 +0000 (10:35 +0900)
commit47412e075266a5f23c66aaaf3abbb76b075c2c15
treedac84eb95f570dd4a2eb8ee822a119f1fd4e90ad
parentcf25498f718a35addf0fc783691538d91d60dcf8
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
src/backend/access/heap/heapam.c