From 9fdf5e99a7960e030a1bf0ec61894fabc3732151 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 3 Mar 2007 16:53:07 +0000 Subject: 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 --- src/modules/m_cgiirc.cpp | 12 ++++++------ 1 file 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 -- cgit v1.2.3