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

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

Thread Next
From:
bulk88 via RT
Date:
April 30, 2014 01:45
Subject:
[perl #121711] [PATCH] Coverity: perlio.c: accessing out-of-scope stack variable
Message ID:
rt-4.0.18-29484-1398822316-379.121711-15-0@perl.org
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 hotmail.com

---
via perlbug:  queue: perl5 status: resolved
https://rt.perl.org/Ticket/Display.html?id=121711

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About