]> granicus.if.org Git - postgresql/commitdiff
Fix uninitialized variables in json's populate_record_worker().
authorAndrew Dunstan <andrew@dunslane.net>
Wed, 26 Mar 2014 22:20:56 +0000 (18:20 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Wed, 26 Mar 2014 22:20:56 +0000 (18:20 -0400)
Peter Geoghegan.

src/backend/utils/adt/jsonfuncs.c

index bf1646771423fe8faaa12898e53fdd3fbbd92fef..73923951e8073a0715f98a9951f93ac18caa7584 100644 (file)
@@ -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 ||