summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-03-03 16:53:07 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-03-03 16:53:07 +0000
commit9fdf5e99a7960e030a1bf0ec61894fabc3732151 (patch)
tree5a9ace561359ea72f81df7af9c5d382bceb7d7e1
parent5fa6825aa319ee37a37b7c7d11f542c83e2f8333 (diff)
Fix double-dereference in CheckIdent and CheckPass which causes the values of the userrec to be overwritten with an ascii ip address. (oops!) Fixes primary cause for bug #215, NEEDS QA TESTING
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6620 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_cgiirc.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index 2169eb4bb..7f39ec1f8 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -300,11 +300,11 @@ public:
bool valid = false;
#ifdef IPV6
if (user->GetProtocolFamily() == AF_INET6)
- valid = (inet_pton(AF_INET6, user->password, &((sockaddr_in6*)&user->ip)->sin6_addr) > 0);
+ valid = (inet_pton(AF_INET6, user->password, &((sockaddr_in6*)user->ip)->sin6_addr) > 0);
else
- valid = (inet_aton(user->password, &((sockaddr_in*)&user->ip)->sin_addr));
+ valid = (inet_aton(user->password, &((sockaddr_in*)user->ip)->sin_addr));
#else
- if (inet_aton(user->password, &((sockaddr_in*)&user->ip)->sin_addr))
+ if (inet_aton(user->password, &((sockaddr_in*)user->ip)->sin_addr))
valid = true;
#endif
if (valid)
@@ -364,11 +364,11 @@ public:
user->Extend("cgiirc_realip", new std::string(user->GetIPString()));
#ifdef IPV6
if (user->GetProtocolFamily() == AF_INET6)
- inet_pton(AF_INET6, newip, &((sockaddr_in6*)&user->ip)->sin6_addr);
+ inet_pton(AF_INET6, newip, &((sockaddr_in6*)user->ip)->sin6_addr);
else
- inet_aton(newip, &((sockaddr_in*)&user->ip)->sin_addr);
+ inet_aton(newip, &((sockaddr_in*)user->ip)->sin_addr);
#else
- inet_aton(newip, &((sockaddr_in*)&user->ip)->sin_addr);
+ inet_aton(newip, &((sockaddr_in*)user->ip)->sin_addr);
#endif