diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-04 16:42:42 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-04 16:42:42 +0000 |
commit | 87b8062151235cfce221c6a05c2e6ab41f120cf7 (patch) | |
tree | 848025b0a92afddd879fbd940dcb5b559340e00f | |
parent | 0d86cc3dd66c4daf8d6cf7a1ffb8d306a83aab5a (diff) |
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
-rw-r--r-- | src/modules/m_ident.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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) |