Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: Paper for the "Weeding out security bugs" Debconf6 workshop: msg#00015

Subject: Re: Paper for the "Weeding out security bugs" Debconf6 workshop
Ulf Harnhammar writes:

> Consequently, 'open(INPUT, $file)' should often be written as
> 'open(INPUT, "<$file")' to avoid any problems.

I prefer to have the mode character be a separate argument:

    open($fh, '<', $file);

That way any additional characters will not be interpreted as mode
characters (there are some multi-character modes).  And, of course,
$file has already been checked with an input validation function, right?
:)


-- 
http://www.noncombatant.org/
http://www.boshuda.com/


<Prev in Thread] Current Thread [Next in Thread>