Skip to content

Commit

Permalink
Fix caching bug in Nameserver::new()
Browse files Browse the repository at this point in the history
A nameserver constructed with a name of "0" could be mistakenly cached
as having no name, because in Perl, the string "0" is falsey. It’s
better to test for string emptyness instead.
  • Loading branch information
marc-vanderwal committed Jan 22, 2025
1 parent 06d23fb commit 1e06bfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Zonemaster/Engine/Nameserver.pm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ sub new {
if !blessed $attrs->{name} || !$attrs->{name}->isa( 'Zonemaster::Engine::DNSName' );

my $name = lc( q{} . $attrs->{name} );
$name = '$$$NONAME' unless $name;
$name = '$$$NONAME' if $name eq q{};

my $address;

Expand Down

0 comments on commit 1e06bfe

Please sign in to comment.