mirror of
https://github.com/znc/znc.git
synced 2026-08-08 01:43:03 +02:00
Disallow CIDR /00000
This commit is contained in:
+1
-10
@@ -864,16 +864,7 @@ bool CUser::IsHostAllowed(const CString& sHostMask) const {
|
||||
|
||||
// If iRoutingPrefix is 0, it could be due to ToInt() failing, so
|
||||
// sRoutingPrefix needs to be all zeroes
|
||||
if (iRoutingPrefix == 0) {
|
||||
bool bBadPrefix = false;
|
||||
for (const char c : sRoutingPrefix) {
|
||||
if (c != '0') {
|
||||
bBadPrefix = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bBadPrefix) continue;
|
||||
}
|
||||
if (iRoutingPrefix == 0 && !sRoutingPrefix.Equals("0")) continue;
|
||||
|
||||
// Convert each IP from a numeric string to an addrinfo
|
||||
addrinfo aiHints;
|
||||
|
||||
Reference in New Issue
Block a user