diff options
| author | 2022-11-24 19:16:25 +0000 | |
|---|---|---|
| committer | 2022-11-24 19:16:25 +0000 | |
| commit | b045f49afbb7e0b0af7bae84f075d3e0660b39e6 (patch) | |
| tree | 390de1d1664cb157b0ce4c1ee2d266a55733efaa /src/cidr.cpp | |
| parent | Use string_view in IsNick/IsIdent/IsChannel. (diff) | |
| parent | Add a workaround for the replies API not working with a cap reference. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/cidr.cpp')
| -rw-r--r-- | src/cidr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cidr.cpp b/src/cidr.cpp index 75d8326e2..766dc1538 100644 --- a/src/cidr.cpp +++ b/src/cidr.cpp @@ -68,9 +68,9 @@ bool irc::sockets::MatchCIDR(const std::string& address, const std::string& cidr } const std::string::size_type per_pos = cidr_copy.rfind('/'); - if ((per_pos == std::string::npos) || (per_pos == cidr_copy.length()-1) + if ((per_pos != std::string::npos) && ((per_pos == cidr_copy.length()-1) || (cidr_copy.find_first_not_of("0123456789", per_pos+1) != std::string::npos) - || (cidr_copy.find_first_not_of("0123456789abcdefABCDEF.:") < per_pos)) + || (cidr_copy.find_first_not_of("0123456789abcdefABCDEF.:") < per_pos))) { // The CIDR mask is invalid return false; |
