Subject: | Unescaped escape in hostname regex string allows invalid matches |
Date: | Thu, 7 Jan 2010 12:26:20 -0500 |
To: | bug-Regexp-Common-IRC [...] rt.cpan.org |
From: | Rob West <robertfwest [...] gmail.com> |
The patch below fixes the bug where a_b would match even though it is
not valid according to the RFC.
--- Regexp-Common-IRC-0.04/lib/Regexp/Common/IRC.pm.hostname
2010-01-07 12:10:18.000000000 -0500
+++ Regexp-Common-IRC-0.04/lib/Regexp/Common/IRC.pm 2010-01-07
12:10:34.000000000 -0500
@@ -167,7 +167,7 @@
create => qq/(?k:$shortname)/,
;
-my $hostname = "$shortname(?:\.$shortname)*";
+my $hostname = "$shortname(?:\\.$shortname)*";
pattern
name => [qw(IRC hostname -keep)],
create => qq/(?k:$hostname)/,