]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Ensure that slots are zeroed before use
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Tue, 26 Oct 2021 08:40:08 +0000 (10:40 +0200)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Tue, 26 Oct 2021 08:40:08 +0000 (10:40 +0200)
commit1ed1f801cdd114822a5f08409f23a7f22be0b9fb
tree146464a96f124f103ec2141f31e340d601adc16a
parenta6a0ae127e76da58e0396cd0f21a97066da2115b
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@paquier.xyz>
Discussion: https://postgr.es/m/CAJ7c6TP0AowkUgNL6zcAK-s5HYsVHVBRWfu69FRubPpfwZGM9A@mail.gmail.com
Backpatch-through: 14
src/backend/catalog/heap.c
src/backend/catalog/pg_shdepend.c