Skip to content

Commit

Permalink
git-send-email.perl: ensure $domain is defined before using it
Browse files Browse the repository at this point in the history
valid_fqdn() may attempt to operate on an undefined value if
Net::Domain::domainname fails to determine the domain name.  This causes
perl to emit unpleasant warnings.

So, add a check for whether $domain has been defined before using it.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Sep 27, 2010
1 parent b822423 commit 61ef5e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-send-email.perl
Original file line number Diff line number Diff line change
@@ -895,7 +895,7 @@ sub sanitize_address {

sub valid_fqdn {
my $domain = shift;
return !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./;
return defined $domain && !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./;
}

sub maildomain_net {

0 comments on commit 61ef5e9

Please sign in to comment.