From 031e91de6e06e6b0d12603d78170f92f5def1d00 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Mon, 10 May 2021 23:06:23 +0200 Subject: [PATCH] Fix: [Network] Check on CIDR for netmask check considered everything valid --- src/network/core/address.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/core/address.cpp b/src/network/core/address.cpp index 91a481795c..044df00503 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);