diff options
author | Rubidium <rubidium@openttd.org> | 2021-05-10 23:06:23 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-05-15 10:16:10 +0200 |
commit | 031e91de6e06e6b0d12603d78170f92f5def1d00 (patch) | |
tree | e5cfb12765fda79e94e6501feb2f958e154573cb /src/network/core | |
parent | e6f0d63e258d9847ed564864ddc04967d780c1de (diff) | |
download | openttd-031e91de6e06e6b0d12603d78170f92f5def1d00.tar.xz |
Fix: [Network] Check on CIDR for netmask check considered everything valid
Diffstat (limited to 'src/network/core')
-rw-r--r-- | src/network/core/address.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/core/address.cpp b/src/network/core/address.cpp index 91a481795..044df0050 100644 --- a/src/network/core/address.cpp +++ b/src/network/core/address.cpp @@ -170,7 +170,7 @@ bool NetworkAddress::IsInNetmask(const char *netmask) int tmp_cidr = atoi(chr_cidr + 1); /* Invalid CIDR, treat as single host */ - if (tmp_cidr > 0 || tmp_cidr < cidr) cidr = tmp_cidr; + if (tmp_cidr > 0 && tmp_cidr < cidr) cidr = tmp_cidr; /* Remove the / so that NetworkAddress works on the IP portion */ std::string ip_str(netmask, chr_cidr - netmask); |