From b7caf477e6ac3a6ba5790c0915783be02b8b6d41 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 3 Feb 2010 08:26:07 +0000 Subject: Don't try to use CIDR matching unless a CIDR range has been given in MatchCIDR git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12360 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cidr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cidr.cpp b/src/cidr.cpp index 535930026..c7ad9174a 100644 --- a/src/cidr.cpp +++ b/src/cidr.cpp @@ -75,6 +75,9 @@ bool irc::sockets::MatchCIDR(const std::string &address, const std::string &cidr cidr_copy.assign(cidr_mask); } + if (cidr_copy.find('/') == std::string::npos) + return false; + irc::sockets::sockaddrs addr; irc::sockets::aptosa(address_copy, 0, addr); @@ -82,7 +85,6 @@ bool irc::sockets::MatchCIDR(const std::string &address, const std::string &cidr irc::sockets::cidr_mask mask2(addr, mask.length); return mask == mask2; - } -- cgit v1.2.3