diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-03 08:26:07 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-03 08:26:07 +0000 |
commit | b7caf477e6ac3a6ba5790c0915783be02b8b6d41 (patch) | |
tree | aa892eee63186e1f2314cbd9985f40eed3db76f6 /src | |
parent | bd965ad19f3288832a5a8edab8739f658da4c8f4 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/cidr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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; - } |