From f7778bb5c75a0f20ff476c091072e792500ea3cc Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sun, 9 Nov 2014 12:34:53 -0800 Subject: [PATCH] Util.pm: is_dns_hostname no more than 255 characters allowed As required by the applicable standards. --- Girocco/Util.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Girocco/Util.pm b/Girocco/Util.pm index 8138b20..1a6c6b1 100644 --- a/Girocco/Util.pm +++ b/Girocco/Util.pm @@ -216,6 +216,7 @@ sub is_dns_hostname { return 0 if $host eq '' || $host =~ /\s/; # first remove a trailing '.' $host =~ s/\.$//; + return 0 if length($host) > 255; my $octet = '(?:\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])'; return 0 if $host =~ /^$octet\.$octet\.$octet\.$octet$/o; my @labels = split(/[.]/, $host, -1); -- 2.11.4.GIT