]> jfr.im git - solanum.git/blobdiff - ircd/parse.c
appveyor: sanity check cc1
[solanum.git] / ircd / parse.c
index 61d7a485073a30721dd10ee056604e79e7b62c8e..9760e6e7a45e911b70af52982569b0696fe78849 100644 (file)
@@ -107,7 +107,7 @@ parse(struct Client *client_p, char *pbuffer, char *bufend)
                return;
        }
 
-       if (msgbuf.origin != NULL)
+       if (msgbuf.origin != NULL && IsServer(client_p))
        {
                from = find_client(msgbuf.origin);
 
@@ -146,6 +146,15 @@ parse(struct Client *client_p, char *pbuffer, char *bufend)
                                struct alias_entry *aptr = rb_dictionary_retrieve(alias_dict, msgbuf.cmd);
                                if (aptr != NULL)
                                {
+                                       if (msgbuf.n_para < 2)
+                                       {
+                                               sendto_one(client_p, form_str(ERR_NEEDMOREPARAMS),
+                                                          me.name,
+                                                          EmptyString(client_p->name) ? "*" : client_p->name,
+                                                          msgbuf.cmd);
+                                               return;
+                                       }
+
                                        do_alias(aptr, client_p, reconstruct_parv(msgbuf.n_para - 1, msgbuf.para + 1));
                                        return;
                                }
@@ -177,7 +186,7 @@ parse(struct Client *client_p, char *pbuffer, char *bufend)
                        /* Its expected this nasty code can be removed
                         * or rewritten later if still needed.
                         */
-                       if((unsigned long) (p + 8) > (unsigned long) end)
+                       if((p + 8) > end)
                        {
                                for (; p <= end; p++)
                                {
@@ -567,14 +576,13 @@ static void do_alias(struct alias_entry *aptr, struct Client *source_p, char *te
                        text);
 }
 
-int
+void
 m_not_oper(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
-       return 0;
 }
 
-int
+void
 m_unregistered(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        /* bit of a hack.
@@ -587,19 +595,16 @@ m_unregistered(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *
                sendto_one(client_p, form_str(ERR_NOTREGISTERED), me.name);
                client_p->localClient->number_of_nick_changes++;
        }
-
-       return 0;
 }
 
-int
+void
 m_registered(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        sendto_one(client_p, form_str(ERR_ALREADYREGISTRED), me.name, source_p->name);
-       return 0;
 }
 
-int
+void
 m_ignore(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
-       return 0;
+       /* Does nothing */
 }