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 | |
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
-rwxr-xr-x | src/svn-rev.sh | 2 | ||||
-rw-r--r-- | src/users.cpp | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/svn-rev.sh b/src/svn-rev.sh index f783b9ba6..8e804010c 100755 --- a/src/svn-rev.sh +++ b/src/svn-rev.sh @@ -1 +1 @@ -echo 3430 +echo 3432 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; |