From 14cd83de10e5725db6f159a9cfe8d0c8d7bd9b59 Mon Sep 17 00:00:00 2001 From: oy Date: Fri, 20 Apr 2012 22:20:11 +0200 Subject: fixed ban range check to make sure the whole ip matches and not just rely on the hash. Closes #946 --- src/engine/shared/netban.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/engine') diff --git a/src/engine/shared/netban.h b/src/engine/shared/netban.h index 447a838d..6d690164 100644 --- a/src/engine/shared/netban.h +++ b/src/engine/shared/netban.h @@ -34,7 +34,7 @@ protected: bool NetMatch(const CNetRange *pRange, const NETADDR *pAddr, int Start, int Length) const { - return pRange->m_LB.type == pAddr->type && + return pRange->m_LB.type == pAddr->type && (Start == 0 || mem_comp(&pRange->m_LB.ip[0], &pAddr->ip[0], Start) == 0) && mem_comp(&pRange->m_LB.ip[Start], &pAddr->ip[Start], Length-Start) <= 0 && mem_comp(&pRange->m_UB.ip[Start], &pAddr->ip[Start], Length-Start) >= 0; } -- cgit 1.4.1