From 87b8062151235cfce221c6a05c2e6ab41f120cf7 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 4 Oct 2006 16:42:42 +0000 Subject: Fix jamies fix (you cant strcpy to a char* pointer, without first allocating some memory!) -- made it char newident[MAXBUF]. Added extra fixage for when the ident module gets 'connection refused' right away, this also prepends the ~ properly too now git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5413 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_ident.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index cacb405cb..040e856d4 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -52,7 +52,7 @@ class RFC1413 : public InspSocket // so we just display a notice, and tidy off the ident_data. if (u && (Instance->SE->GetRef(ufd) == u)) { - char *newident; + char newident[MAXBUF]; u->Shrink("ident_data"); u->WriteServ("NOTICE "+std::string(u->nick)+" :*** Could not find your ident, using ~"+std::string(u->ident)+" instead."); strcpy(newident,"~"); @@ -221,7 +221,14 @@ class ModuleIdent : public Module user->Extend("ident_data", (char*)ident); } else + { + char newident[MAXBUF]; + user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Could not find your ident, using ~"+std::string(user->ident)+" instead."); + strcpy(newident,"~"); + strlcat(newident,user->ident,IDENTMAX); + strlcpy(user->ident,newident,IDENTMAX); delete ident; + } } virtual bool OnCheckReady(userrec* user) -- cgit v1.2.3