develooper Front page | perl.perl5.porters | Postings from January 2008

Re: [perl #50322] CGITempFile causes "Insecure dependency in sprintf"in perl 5.10.0

Thread Previous
From:
Steffen Mueller
Date:
January 28, 2008 10:37
Subject:
Re: [perl #50322] CGITempFile causes "Insecure dependency in sprintf"in perl 5.10.0
Message ID:
479E20FA.90803@sneakemail.com
Hi,

Dr.Ruud schrieb:
> Steffen Mueller schreef:
> 
>> How about changing the sprintf call to this (untested, but well...):
>>
>> sprintf("\%s${SL}CGItemp%d", $TMPDIRECTORY, $sequence++)
> 
> Why not work out ${SL} as well?
> 
> Even if it is currently guaranteed to never contain anything like "%d",
> etc.

No specific reason. In fact, $SL is the directory separator of the 
system and thus very unlikely to ever contain a format-relevant 
substring. But really, I just made the smallest possible change - it's 
not my code after all. I would probably have written

$TMPDIRECTORY . $SL . sprintf('%d', $sequence++)

but that's purely a matter of preference.

Cheers,
Steffen


Thread Previous


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