in reply to Spurious "Insecure dependency" error in CGI.pm

Use perlbug to report this bug in perl

To fix CGI.pm use this patch

--- C:\perl\5.14.1\lib\CGI.pm 2011-06-03 08:36:31.000000000 -0700 +++ CGI.pm 2011-09-14 07:49:32.031250000 -0700 @@ -530,7 +530,7 @@ my $val = $QUERY_PARAM{$name}; # always an arrayref; $self->param('-name'=>$name,'-value'=> $val); if (defined $val and ref $val eq 'ARRAY') { - for my $fh (grep {defined(fileno($_))} @$val) { + for my $fh (grep {ref($_) and defined(fileno($_))} @$ +val) { seek($fh,0,0); # reset the filehandle. }

No point in checking vals which aren't overloaded filehandles :)

Replies are listed 'Best First'.
Re^2: Spurious "Insecure dependency" error in CGI.pm
by Anonymous Monk on Sep 14, 2011 at 15:00 UTC
    I thought, maybe, for good measure, this patch also
    @@ -820,7 +820,7 @@ # put a filehandle into binary mode (DOS) sub binmode { - return unless defined($_[1]) && defined fileno($_[1]); + return unless defined($_[1]) && ref ($_[1]) && defined fileno($_[ +1]); CORE::binmode($_[1]); }

    But this fix might trigger other bugs

    Needs more extensive testing :/

      Thanks people! I have added the patch to the ticket on CPAN.