summaryrefslogtreecommitdiff
path: root/modules/protocol/unreal.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-10-25 01:30:41 -0400
committerAdam <Adam@anope.org>2012-10-25 01:30:41 -0400
commit10e21bfedaa5aea8a3b3565b596de2dd25230f53 (patch)
tree986830a8eaf4f449e65423167fdd57ebec6c3dec /modules/protocol/unreal.cpp
parent00256fdba85e670f0cd41359a38a599272f70678 (diff)
Fix handling clients on unreal that have no ip (it sends a *)
Diffstat (limited to 'modules/protocol/unreal.cpp')
-rw-r--r--modules/protocol/unreal.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp
index aab6ae32d..25f030535 100644
--- a/modules/protocol/unreal.cpp
+++ b/modules/protocol/unreal.cpp
@@ -776,8 +776,14 @@ struct IRCDMessageNick : IRCDMessage
Anope::string decoded_ip;
Anope::B64Decode(params[9], decoded_ip);
- sockaddrs ip;
- ip.ntop(params[9].length() == 8 ? AF_INET : AF_INET6, decoded_ip.c_str());
+ Anope::string ip;
+ try
+ {
+ sockaddrs ip_addr;
+ ip_addr.ntop(params[9].length() == 8 ? AF_INET : AF_INET6, decoded_ip.c_str());
+ ip = ip_addr.addr();
+ }
+ catch (const SocketException &ex) { }
Anope::string vhost = params[8];
if (vhost.equals_cs("*"))
@@ -785,7 +791,7 @@ struct IRCDMessageNick : IRCDMessage
time_t user_ts = params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : Anope::CurTime;
- User *user = new User(params[0], params[3], params[4], vhost, ip.addr(), source.GetServer(), params[10], user_ts, params[7]);
+ User *user = new User(params[0], params[3], params[4], vhost, ip, source.GetServer(), params[10], user_ts, params[7]);
const NickAlias *na = NULL;