pgsql: PL/Python: Fix potential NULL pointer dereference

Поиск
Список
Период
Сортировка
Искать
От
Peter Eisentraut
Тема
pgsql: PL/Python: Fix potential NULL pointer dereference
Дата
Msg-id
E1eJin0-0002iK-Ge@gemulon.postgresql.org
Список
Дерево обсуждения
pgsql: PL/Python: Fix potential NULL pointer dereference Peter Eisentraut <peter_e@gmx.net>
Re: pgsql: PL/Python: Fix potential NULL pointer dereference Tom Lane <tgl@sss.pgh.pa.us>
Re: pgsql: PL/Python: Fix potential NULL pointer dereference Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: pgsql: PL/Python: Fix potential NULL pointer dereference Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: pgsql: PL/Python: Fix potential NULL pointer dereference Tom Lane <tgl@sss.pgh.pa.us>
Re: pgsql: PL/Python: Fix potential NULL pointer dereference Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: pgsql: PL/Python: Fix potential NULL pointer dereference Tom Lane <tgl@sss.pgh.pa.us>
PL/Python: Fix potential NULL pointer dereference

After d0aa965c0a0ac2ff7906ae1b1dad50a7952efa56, one error path in
PLy_spi_execute_fetch_result() could result in the variable "result"
being dereferenced after being set to NULL.  To fix that, just clear the
resources right there and return early.

Also add another SPI_freetuptable() call so that that is cleared in all
error paths.

discovered by John Naylor  via scan-build

Branch
------
master

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

Modified Files
--------------
src/pl/plpython/plpy_spi.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

В списке pgsql-committers по дате отправления
От: Robert Haas
Дата:
От: Tom Lane
Дата:
FAQ