From bd31fbb9f0bd0ff282c6413928e61b819f0ee474 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 22 Feb 2012 14:41:36 -0500 Subject: [PATCH] Also fixed m_proxyscan to handle users with invalid ips --- modules/extra/m_proxyscan.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/extra/m_proxyscan.cpp b/modules/extra/m_proxyscan.cpp index ea35e8f77..badc293fc 100644 --- a/modules/extra/m_proxyscan.cpp +++ b/modules/extra/m_proxyscan.cpp @@ -346,10 +346,17 @@ class ModuleProxyScan : public Module if (exempt || !user || !Me->IsSynced() || !user->server->IsSynced()) return; - sockaddrs user_ip(user->ip); /* At this time we only support IPv4 */ - if (user_ip.sa.sa_family != AF_INET) + sockaddrs user_ip; + try + { + user_ip.pton(AF_INET, user->ip); + } + catch (const SocketException &) + { + /* User doesn't have a valid IPv4 IP (ipv6/spoof/etc) */ return; + } if (!this->con_notice.empty() && !this->con_source.empty()) {