Avoid use of uninitialized variable (src/pl/plperl/plperl.c)

Started by Ranier Vilela8 months ago3 messageshackers
Jump to latest
#1Ranier Vilela
ranier.vf@gmail.com

Hi.

In (src/pl/plperl/plperl.c) if *PERL_SYS_INIT3* is defined and
*MYMALLOC* is not, is possible use of variable
*perl_sys_init_done* uninitialized.

To fix, explicitly initialize the variable.
In pass change type to bool, what was the initial intention.

trivial patch attached.

best regards,
Ranier Vilela

Attachments:

v1-001-avoid-use-uninitialized-variable-plperl.patchapplication/octet-stream; name=v1-001-avoid-use-uninitialized-variable-plperl.patchDownload+2-2
#2Andres Freund
andres@anarazel.de
In reply to: Ranier Vilela (#1)
Re: Avoid use of uninitialized variable (src/pl/plperl/plperl.c)

Hi,

On 2025-09-02 14:39:44 -0300, Ranier Vilela wrote:

In (src/pl/plperl/plperl.c) if *PERL_SYS_INIT3* is defined and
*MYMALLOC* is not, is possible use of variable
*perl_sys_init_done* uninitialized.

Static variables are zero initialized by definition, no?

Greetings,

Andres Freund

#3Ranier Vilela
ranier.vf@gmail.com
In reply to: Andres Freund (#2)
Re: Avoid use of uninitialized variable (src/pl/plperl/plperl.c)

Em ter., 2 de set. de 2025 às 14:42, Andres Freund <andres@anarazel.de>
escreveu:

Hi,

On 2025-09-02 14:39:44 -0300, Ranier Vilela wrote:

In (src/pl/plperl/plperl.c) if *PERL_SYS_INIT3* is defined and
*MYMALLOC* is not, is possible use of variable
*perl_sys_init_done* uninitialized.

Static variables are zero initialized by definition, no?

Yeah. My bad, sorry for the noise.

best regards,
Ranier Vilela