pgsql: Free SQLSTATE and SQLERRM no earlier than other PL/pgSQL variabl - Mailing list pgsql-committers

From Noah Misch
Subject pgsql: Free SQLSTATE and SQLERRM no earlier than other PL/pgSQL variabl
Date
Msg-id E1YQqUq-00088j-Sm@gemulon.postgresql.org
Whole thread Raw
List 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_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/4651e37cb1c9cc34643921bdc8b783d1c81b488f

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(-)


pgsql-committers by date:

Previous
From: Stephen Frost
Date:
Subject: pgsql: Add hasRowSecurity to copyfuncs/outfuncs
Next
From: Noah Misch
Date:
Subject: pgsql: Free SQLSTATE and SQLERRM no earlier than other PL/pgSQL variabl