mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Bug#127 fixes
git-svn-id: http://svn.inspircd.org/repository/branches/1_0_stable@4588 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
558c923d80
commit
eeac4cea83
@ -454,10 +454,6 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
|
||||
return;
|
||||
}
|
||||
|
||||
// Empty mode string!
|
||||
if (!*parameters[1])
|
||||
return;
|
||||
|
||||
char outlist[MAXBUF];
|
||||
char mlist[MAXBUF];
|
||||
char *outpars[32];
|
||||
@ -488,6 +484,10 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
|
||||
|
||||
log(DEBUG,"process_modes: modelist: %s",modelist);
|
||||
|
||||
/* Related to BUG #127, can cause stack corruption if we allow an empty modestring */
|
||||
if (!*modelist)
|
||||
return;
|
||||
|
||||
int len = tidied.length();
|
||||
while (modelist[len-1] == ' ')
|
||||
modelist[--len] = '\0';
|
||||
|
Loading…
x
Reference in New Issue
Block a user