XLogInsert() of dangling pointer while logging replica identity

From: Stas Kelvich <s(dot)kelvich(at)postgrespro(dot)ru>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: XLogInsert() of dangling pointer while logging replica identity
Date: 2019-01-31 20:51:36
Message-ID: 085C8825-AD86-4E93-AF80-E26CDF03D1EA@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
0001-Fix-use-after-scope.patch application/octet-stream 1016 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2019-01-31 21:18:40 Re: [HACKERS] Block level parallel vacuum
Previous Message Lætitia Avrot 2019-01-31 20:45:25 Re: [Patch] Log10 and hyperbolic functions for SQL:2016 compliance