Fix crash in json_to_record().

Jeff Davis <jdavis@postgresql.org>

Commit: 486ea0b19e08c10ff53e36e46209a928df048281
Author: Jeff Davis <jdavis@postgresql.org>
Date: 2014-02-26T15:47:41Z
Releases: 9.4.0
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.

Files

PathChange+/−
src/backend/utils/adt/jsonfuncs.c modified +17 −3