From 7f4395d336c331dd434bca91b6273c072f26e1bc Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 1 Apr 2005 21:04:04 +0000 Subject: Fixed 'unlikely' crash if nick was changed before dns lookup was completed git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@942 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/commands.cpp') diff --git a/src/commands.cpp b/src/commands.cpp index 7eed17478..0af56645d 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -51,6 +51,7 @@ #include "mode.h" #include "xline.h" #include "inspstring.h" +#include "dnsqueue.h" #ifdef GCC3 #define nspace __gnu_cxx @@ -1638,7 +1639,12 @@ void handle_nick(char **parameters, int pcnt, userrec *user) log(DEBUG,"new nick set: %s",user->nick); if (user->registered < 3) + { user->registered = (user->registered | 2); + // dont attempt to look up the dns until they pick a nick... because otherwise their pointer WILL change + // and unless we're lucky we'll get a duff one later on. + lookup_dns(user); + } if (user->registered == 3) { /* user is registered now, bit 0 = USER command, bit 1 = sent a NICK command */ -- cgit v1.3.1-10-gc9f91