Re: ecpg assertion on windows - Mailing list pgsql-hackers

From Andres Freund
Subject Re: ecpg assertion on windows
Date
Msg-id 20220824040118.7jrf5hnszadcscgl@awork3.anarazel.de
Whole thread Raw
In response to ecpg assertion on windows  (Andres Freund <andres@anarazel.de>)
Responses Re: ecpg assertion on windows
List pgsql-hackers
Hi,

On 2022-08-23 20:36:55 -0700, Andres Freund wrote:
> Running the ecpg regression tests interactively (to try to find a different
> issue), triggered a crash on windows due to an uninitialized variable (after
> pressing "ignore" in that stupid gui window that we've only disabled for the
> backend).
> 
> "The variable 'replace_val' is being used without being initialized."

Looks to me like that's justified. The paths in dttofmtasc_replace using
PGTYPES_TYPE_NOTHING don't set replace_val, but call pgtypes_fmt_replace() -
with replace_val passed by value. If that's the first replacement, an
unitialized variable is passed...

Seems either the caller should skip calling pgtypes_fmt_replace() in the
NOTHING case, or replace_val should be zero initialized?

- Andres



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: ecpg assertion on windows
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: Assertion failure on PG15 with modified test_shm_mq test