Re: [BUG] ECPG crash with union type - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [BUG] ECPG crash with union type
Date
Msg-id 1103650.1782420365@sss.pgh.pa.us
Whole thread
In response to [BUG] ECPG crash with union type  (Jehan-Guillaume de Rorthais <jgdr@dalibo.com>)
Responses Re: [BUG] ECPG crash with union type
List pgsql-hackers
Jehan-Guillaume de Rorthais <jgdr@dalibo.com> writes:
> One of our customer hit a sigsev with ecpg lately. Their team created a simple
> scenario and point us the origin of the crash in ECPG code. The credit goes to
> them (iMSA) for that work.
> ...
> If setting "$$.type_sizeof = NULL;" is legit for unions (I didn't try to wrap
> my head around this code), maybe this change should be:

>     -       ne->struct_sizeof = struct_sizeof;
>     +       ne->struct_sizeof = struct_sizeof ? mm_strdup(struct_sizeof):NULL;

Yeah, I agree.  Will fix, thanks for the report!

            regards, tom lane



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Make pg_prewarm, autoprewarm yield for waiting DDL
Next
From: Haibo Yan
Date:
Subject: Re: Optimize UUID parse using SIMD