Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

This queue is for tickets about the Net-Server CPAN distribution.

Report information
The Basics
Id: 78828
Status: resolved
Priority: 0/
Queue: Net-Server

People
Owner: Nobody in particular
Requestors: SKA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.006
Fixed in: (no value)

Attachments
Net-Server-2.006_peerhost_undef_value.diff



Subject: Use of uninitialized value in pattern match (m//) at /usr/local/share/perl/5.8.8/Net/Server.pm line 600.
Download (untitled) / with headers
text/plain 593b
When reverse_lookups is OFF, there is still a check of the peerhost in: return 0 if $prop->{'peerhost'} =~ /^$_$/ && defined $prop->{'reverse_lookups'}; Because $prop->{'peerhost'} =~ /^$_$/ preceeds $prop->{'reverse_lookups'}. In my case, $prop->{'peerhost'} is undef anyway, so the match will trigger the warning regardless of reverse_lookups currently. I suggest to change the line into: return 0 if defined($prop->{'reverse_lookups'}) && defined($prop->{peerhost}) && $prop->{'peerhost'} =~ /^$_$/; Attached patch changes both deny and allow.
Subject: Net-Server-2.006_peerhost_undef_value.diff
diff -r d0f109fd4dd8 Net/Server.pm --- a/Net/Server.pm Tue Aug 07 10:38:50 2012 +0200 +++ b/Net/Server.pm Tue Aug 07 10:44:26 2012 +0200 @@ -587,7 +587,10 @@ # if the addr or host matches a deny, reject it immediately foreach (@{ $prop->{'deny'} }) { - return 0 if $prop->{'peerhost'} =~ /^$_$/ && defined $prop->{'reverse_lookups'}; + return 0 + if defined($prop->{'reverse_lookups'}) + && defined($prop->{peerhost}) + && $prop->{'peerhost'} =~ /^$_$/; return 0 if $peeraddr =~ /^$_$/; } if (@{ $prop->{'cidr_deny'} }) { @@ -597,7 +600,10 @@ # if the addr or host isn't blocked yet, allow it if it is allowed foreach (@{ $prop->{'allow'} }) { - return 1 if $prop->{'peerhost'} =~ /^$_$/ && defined $prop->{'reverse_lookups'}; + return 1 + if defined($prop->{'reverse_lookups'}) + && defined($prop->{peerhost}) + && $prop->{'peerhost'} =~ /^$_$/; return 1 if $peeraddr =~ /^$_$/; } if (@{ $prop->{'cidr_allow'} }) {
+1. I just saw and was going to report this error today.
Fixed in 2.007
Download (untitled) / with headers
text/plain 283b
Hi! On Thu Jan 10 02:57:58 2013, RHANDOM wrote: Show quoted text
> Fixed in 2.007
Thanks for that btw! I was looking to this issue (originating from the Debian bugreport http://bugs.debian.org/693320), and have a question: Would it make sense to do the same check for $peeraddr? Regards, Salvatore


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.