pgsql: Fix use-after-free in COPY (ON_ERROR)

Поиск
Список
Период
Сортировка
Искать

pgsql: Fix use-after-free in COPY (ON_ERROR)

От:
Michael Paquier <michael@paquier.xyz>
Дата:
Fix use-after-free in COPY (ON_ERROR)

When ON_ERROR handled a soft error, some of the contents set for the
error context callback could remain set and pointing at areas that could
be reset, leading to some use-after-frees depending on the input data
provided through COPY.

These contents are now reset at the beginning of NextCopyFrom(), before
processing the next tuple.

SET_NULL is affected down to v19, IGNORE down to v17.

Author: Gowdham M 
Reviewed-by: Michael Paquier 
Reviewed-by: Shihao Zhong 
Discussion: https://postgr.es/m/1a181ff6be8.6d14feb261368.4036709598649280477@zohocorp.com
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/61b06d2ba61d04398585d6d06b1ee5f4cd53c3b5

Modified Files
--------------
src/backend/commands/copyfromparse.c | 4 ++++
src/test/regress/expected/copy2.out  | 4 ++++
src/test/regress/sql/copy2.sql       | 6 ++++++
3 files changed, 14 insertions(+)

FAQ