pgsql: Free SQLSTATE and SQLERRM no earlier than other PL/pgSQL variabl

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Free SQLSTATE and SQLERRM no earlier than other PL/pgSQL variabl
Date: 2015-02-26 04:56:24
Message-ID: E1YQqUq-00088p-T3@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Free SQLSTATE and SQLERRM no earlier than other PL/pgSQL variables.

"RETURN SQLERRM" prompted plpgsql_exec_function() to read from freed
memory. Back-patch to 9.0 (all supported versions). Little code ran
between the premature free and the read, so non-assert builds are
unlikely to witness user-visible consequences.

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/034d05dbdf6340247b58c80640b2cdfc772f4ee1

Modified Files
--------------
src/pl/plpgsql/src/pl_exec.c | 12 +++---------
src/test/regress/expected/plpgsql.out | 12 ++++++++++++
src/test/regress/sql/plpgsql.sql | 10 +++++++++-
3 files changed, 24 insertions(+), 10 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2015-02-26 06:48:42 pgsql: Add note about how to make the SRF detoasted arguments live accr
Previous Message Stephen Frost 2015-02-26 04:36:28 pgsql: Add hasRowSecurity to copyfuncs/outfuncs