plist[i] = '\0';
strlcpy(blog[j++],param,MAXBUF);
param = plist+i+1;
- if (j > Config->MaxTargets)
+ if ((unsigned int)j > Config->MaxTargets)
{
WriteServ(u->fd,"407 %s %s :Too many targets in list, message not delivered.",u->nick,blog[j-1]);
return 1;
}
else
{
- for (unsigned int i = 0; i <= strlen(cmd); i++)
+ for (char* i = cmd; *i; i++)
{
- cmd[i] = toupper(cmd[i]);
+ *i = toupper(*i);
}
}
}
std::string xcommand = command;
+ if ((user->registered != 7) && (xcommand == "SERVER"))
+ {
+ kill_link(user,"Server connection to non-server port");
+ return;
+ }
/* Tweak by brain - why was this INSIDE the mainloop? */
if (parameters)
if (cm != cmdlist.end())
{
-
- if (user)
+ if (user)
+ {
+ /* activity resets the ping pending timer */
+ user->nping = TIME + user->pingmax;
+ if ((items) < cm->second->min_params)
{
- /* activity resets the ping pending timer */
- user->nping = TIME + user->pingmax;
- if ((items) < cm->second->min_params)
- {
- log(DEBUG,"not enough parameters: %s %s",user->nick,command);
- WriteServ(user->fd,"461 %s %s :Not enough parameters",user->nick,command);
- return;
- }
+ log(DEBUG,"not enough parameters: %s %s",user->nick,command);
+ WriteServ(user->fd,"461 %s %s :Not enough parameters",user->nick,command);
+ return;
+ }
if ((!strchr(user->modes,cm->second->flags_needed)) && (cm->second->flags_needed))
{
log(DEBUG,"permission denied: %s %s",user->nick,command);