XLogInsert() of dangling pointer while logging replica identity

Stas Kelvich <s.kelvich@postgrespro.ru>

From: Stas Kelvich <s.kelvich@postgrespro.ru>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-01-31T20:51:36Z
Lists: pgsql-hackers

Attachments

Hi, hackers.

  It seems that heapam.c:3082 calls XLogRegisterData() with an argument
allocated on stack, but following call to XLogInsert() happens after
end of context for that variable.
  Issue spotted by clang's AddressSanitizer. Fix attached.

--
Stas Kelvich
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

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