[PATCH] git-send-email.perl: ensure $domain is defined before using it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 git-send-email.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 6dab3bf..e1f29a7 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -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 {
-- 
1.7.3.1.geb284

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]