diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-02 17:30:04 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-02 17:30:04 +0000 |
commit | 66a5aabdbd5e5eb75c158f4447b1c5c89b96ad55 (patch) | |
tree | c31c5d5e3fe606a483f2a17090e950f2895de318 /src/users.cpp | |
parent | af03ce859e55f43659062af60ed2431294b4b762 (diff) |
Strdup's to stop corruption of oper classes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3433 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r-- | src/users.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/users.cpp b/src/users.cpp index 5654133ec..11147298f 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -250,26 +250,30 @@ bool userrec::HasPermission(std::string &command) opertype_t::iterator iter_opertype = opertypes.find(this->oper); if (iter_opertype != opertypes.end()) { - char* Classes = iter_opertype->second; + char* Classes = strdup(iter_opertype->second); char* myclass = strtok_r(Classes," ",&savept); while (myclass) { operclass_t::iterator iter_operclass = operclass.find(myclass); if (iter_operclass != operclass.end()) { - char* CommandList = iter_operclass->second; + char* CommandList = strdup(iter_operclass->second); mycmd = strtok_r(CommandList," ",&savept2); while (mycmd) { if ((!strcasecmp(mycmd,command.c_str())) || (*mycmd == '*')) { + free(Classes); + free(CommandList); return true; } mycmd = strtok_r(NULL," ",&savept2); } + free(CommandList); } myclass = strtok_r(NULL," ",&savept); } + free(Classes); } } return false; |