From 36d3fd171085baecce62ac52c2818734ee7bd1f4 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 9 Feb 2011 13:25:28 -0500 Subject: [PATCH] Do not crash if a user is introduced with a nonexistant server --- src/users.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/users.cpp b/src/users.cpp index d9a6149cf..9f1cc8404 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -690,10 +690,12 @@ User *do_nick(const Anope::string &source, const Anope::string &nick, const Anop { if (source.empty()) { - /* This is a new user; create a User structure for it. */ - Log(LOG_DEBUG) << "new user: " << nick; - Server *serv = Server::Find(server); + if (serv == NULL) + { + Log() << "User " << nick << " introduced with nonexistant server " << server << "!"; + return NULL; + } /* Allocate User structure and fill it in. */ dynamic_reference user = new User(nick, username, host, uid);