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:
brain 2006-07-29 19:31:18 +00:00
parent 558c923d80
commit eeac4cea83

View File

@ -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';