Skip Menu |

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

Report information
The Basics
Id: 96535
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: Mark.Martinec [...] ijs.si
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in:
  • 0.76
  • 0.77
Fixed in: (no value)



Subject: Net::DNS::Resolver warns "Use of uninitialized value in length" when called from Net::DNS::Nameserver
Using Net::DNS 0.76 or 0.77, and perl 5.8.9, now reports a warning: $ perl -we 'use Net::DNS::Nameserver; Net::DNS::Nameserver->new( LocalAddr=>"127.0.0.1", LocalPort=>17733, ReplyHandler=>sub{})' Use of uninitialized value in length at ../Net/DNS/Resolver/Base.pm line 318. This happens because Net::DNS::Nameserver::new calls $resolver->nameservers(undef); (near line 92) and the Net::DNS::Resolver::Base::nameservers() now checks for length() instead of defined(): sub nameservers { my $self = shift; my ( @ipv4, @ipv6 ); foreach my $ns (@_) { next unless length($ns); ... The change in Net::DNS::Resolver::Base was introduced in Net::DNS 0.76. Previously (in 0.75) the code there checked for defined(): foreach my $ns (@_) { next unless defined($ns); Note that newer versions of perl no longer report a warning when length() is called on undef, but perl 5.8.9 does produce a warning. Not sure with what version of perl the change was made. Regardless, it is worth avoiding the issue (e.g. reported by a test dnsbl_subtests.t in SpamAssassin) to avoid unnecessary problem reports.
From: rwfranks [...] acm.org
On Wed Jun 18 12:39:40 2014, Mark.Martinec@ijs.si wrote: Show quoted text
> Using Net::DNS 0.76 or 0.77, and perl 5.8.9, now reports a warning:
Show quoted text
> > This happens because Net::DNS::Nameserver::new calls > $resolver->nameservers(undef); (near line 92)
This appears to be the result of a bad fix for RT#32147 (Feb 2008). The intention of line 92 appears to be to empty the nameserver list before repopulating it with @LocalAddr.
Fixed on trunk and in coming 0.78 release