pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: PL/Python: Fix potential NULL pointer dereference
Date: Tue, 28 Nov 2017 16:31:18 +0000
Message-ID: <E1eJin0-0002iK-Ge@gemulon.postgresql.org> (raw)

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 <jcnaylor@gmail.com> 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(-)



view thread (8+ messages)  latest in thread

Message-ID: <E1eJin0-0002iK-Ge@gemulon.postgresql.org>
Permalink:  ../E1eJin0-0002iK-Ge@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1eJin0-0002iK-Ge@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter_e@gmx.net
  Subject: Re: pgsql: PL/Python: Fix potential NULL pointer dereference
  In-Reply-To: <E1eJin0-0002iK-Ge@gemulon.postgresql.org>
  References: <E1eJin0-0002iK-Ge@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox