From 7e4d1600a621ee4e786e715bc82eaad1113dba0e Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Wed, 26 Mar 2014 18:20:56 -0400 Subject: [PATCH] Fix uninitialized variables in json's populate_record_worker(). Peter Geoghegan. --- src/backend/utils/adt/jsonfuncs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c index bf16467714..73923951e8 100644 --- a/src/backend/utils/adt/jsonfuncs.c +++ b/src/backend/utils/adt/jsonfuncs.c @@ -2160,6 +2160,8 @@ populate_record_worker(FunctionCallInfo fcinfo, bool have_record_arg) my_extra = (RecordIOData *) fcinfo->flinfo->fn_extra; my_extra->record_type = InvalidOid; my_extra->record_typmod = 0; + my_extra->ncolumns = ncolumns; + MemSet(my_extra->columns, 0, sizeof(ColumnIOData) * ncolumns); } if (have_record_arg && (my_extra->record_type != tupType || -- 2.40.0