pgsql: Fix crash in json_to_record().

From: Jeff Davis <jdavis(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix crash in json_to_record().
Date: 2014-02-26 15:48:23
Message-ID: E1WIgid-00041b-Ge@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix crash in json_to_record().

json_to_record() depends on get_call_result_type() for the tuple
descriptor of the record that should be returned, but in some cases
that cannot be determined. Add a guard to check if the tuple
descriptor has been properly resolved, similar to other callers of
get_call_result_type().

Also add guard for two other callers of get_call_result_type() in
jsonfuncs.c. Although json_to_record() is the only actual bug, it's a
good idea to follow convention.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/486ea0b19e08c10ff53e36e46209a928df048281

Modified Files
--------------
src/backend/utils/adt/jsonfuncs.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-02-26 16:50:05 pgsql: btbuild no longer calls _bt_doinsert(), update comment.
Previous Message Thom Brown 2014-02-26 13:55:39 Re: pgsql: Allow time delayed standbys and recovery