On 10/13/2014 10:39 AM, Pavel Stehule wrote:
> Hi
>
> A JsonSemAction sem is not well initialized
>
> a array_element_start is not initialized and enforces sigfault on my comp
>
> *** ./utils/adt/jsonb.c.orig 2014-10-13 16:37:00.479708142 +0200
> --- ./utils/adt/jsonb.c 2014-10-13 16:36:33.704650644 +0200
> ***************
> *** 786,791 ****
> --- 786,793 ----
> sem.scalar = jsonb_in_scalar;
> sem.object_field_start =
> jsonb_in_object_field_start;
>
> + sem.array_element_start = NULL;
> +
> pg_parse_json(lex, &sem);
>
> }
>
> I am not sure, if this fix is valid, but all tests are passed now
>
>
Good find. I think what we should probably do is initialize the whole
thing with:
memset(&sem, 0, sizeof(JsonSemAction));
before assigning anything to its fields. That would be consistent with
what we do elsewhere.
I'll make that change and submit a new patch.
Please stop using this thread, however. It's inappropriate for reviewing
this patch.
cheers
andrew