[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#41563: Invalid perl in "install-info"



Package: dpkg
Version: 1.4.1.4
Severity: normal

The "install-info" script contains the following Perl snippet (line
222) :

do {
    last if !@work;
    $_= shift(@work);
    push(@head,$_);
} until (m/^\*\s*Menu:/i);

However, "last" is not valid withing a do {} until block (See, for
example "Programming Perl", page 529).  This isn't normally a problem,
but if the info "dir" file is corrupt in some fashion, it's possible
that the "@work" array will be empty when this construct is reached, at
which point the Perl interpreter will exit with an error.

I suggest that the above loop be rewritten as:

do {
    push(@head, $_ = shift(@work)) if @work;
} until (!@work or m/^\*\s*Menu:/i)

       Colm

-- 
Colm Buckley B.A. B.F. # colm@tuatha.org colm.buckley@tcd.ie colm@computer.org
Department of Computer Science      # +353 87 2469146 # whois cb3765
Trinity College, Dublin 2, Ireland. # http://www.tuatha.org/~colm/
Al Capone's business card said he was a used furniture dealer.


Reply to: