Fix null-pointer crash in ECPG compiler.

When compiling a DECLARE section containing a union nested
inside a struct, ecpg passes a null value for struct_sizeof to
ECPGmake_struct_type.  I (tgl) didn't foresee that case in
commit 0e6060790, and wrote an unprotected mm_strdup() call.

Reported-by: iMSA (via Jehan-Guillaume de Rorthais <[email protected]>)
Author: Jehan-Guillaume de Rorthais <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/20260625114849.34b2148e@karst
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/917fdbc633e24e652427e102bf51484f3e1ab2f2

Modified Files
--------------
src/interfaces/ecpg/preproc/type.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Reply via email to