summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-02-22 14:41:36 -0500
committerAdam <Adam@anope.org>2012-02-22 14:41:36 -0500
commitbd31fbb9f0bd0ff282c6413928e61b819f0ee474 (patch)
tree7ddf8ae701b1d07671aa07a82bb176b40b14267c /modules
parent000660608eaa3be3f55333ee0c1080c72461f533 (diff)
Also fixed m_proxyscan to handle users with invalid ips
Diffstat (limited to 'modules')
-rw-r--r--modules/extra/m_proxyscan.cpp11
1 files 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())
{