develooper Front page | perl.perl5.porters | Postings from April 2014

[perl #121711] [PATCH] Coverity: perlio.c: accessing out-of-scope stack variable

Thread Next
bulk88 via RT
April 30, 2014 01:45
[perl #121711] [PATCH] Coverity: perlio.c: accessing out-of-scope stack variable
Message ID:
On Tue Apr 22 17:32:08 2014, jhi wrote:
> Attached.

This patch needed a clearer explanation. It took me a long time to figure out what this patch is fixing. It should have mentioned that PerlIOStdio_mode returns tmode, and "mode" was assigned a * to an out of scope C auto.

Ideally tmode should be renamed to "buf", or PerlIOStdio_mode should return void and the caller knows what * it passed. PerlIOStdio_mode's API falls into the stupid category with localtime() and strerror().

Asm wise, this makes no difference on VC 2003 (maybe it will on other CC/archs, liveness etc), before this patch Perl_PerlIO_flush already fell through to PerlIOBase_pushed and tmode was alloced through the whole C function.

bulk88 ~ bulk88 at

via perlbug:  queue: perl5 status: resolved

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About