pgsql: Ensure that slots are zeroed before use

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Ensure that slots are zeroed before use
Date: 2021-10-26 08:44:31
Message-ID: E1mfI4N-0006ai-BH@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Ensure that slots are zeroed before use

The previous coding relied on the memory for the slots being zeroed
elsewhere, which while it was true in this case is not an contract
which is guaranteed to hold. Explicitly clear the tts_isnull array
to ensure that the slots are filled from a known state.

Backpatch to v14 where the catalog multi-inserts were introduced.

Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://postgr.es/m/CAJ7c6TP0AowkUgNL6zcAK-s5HYsVHVBRWfu69FRubPpfwZGM9A@mail.gmail.com
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e63ce9e8d6ac8dced20592c4134004640f9f5644

Modified Files
--------------
src/backend/catalog/heap.c | 3 +++
src/backend/catalog/pg_shdepend.c | 3 +++
2 files changed, 6 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2021-10-26 08:45:07 pgsql: Ensure that slots are zeroed before use
Previous Message Michael Paquier 2021-10-26 04:58:05 Re: pgsql: Allow pg_receivewal to stream from a slot's restart LSN