]> PatchyGit - patchyircd.git/commitdiff
fix infinite loop with MODE +o
authorEgor <egor@patchysicp.xyz>
Sun, 8 May 2022 09:35:20 +0000 (12:35 +0300)
committerEgor <egor@patchysicp.xyz>
Sun, 8 May 2022 09:35:20 +0000 (12:35 +0300)
irc.c

diff --git a/irc.c b/irc.c
index 807097b..1f8af04 100644 (file)
--- a/irc.c
+++ b/irc.c
@@ -569,17 +569,17 @@ int processPacket(struct client_data *client, char *source, char *command, int a
                                        case 'v':
                                        case 'o':
                                                if(!*argp)
-                                                       continue;
+                                                       break;
                                                const char *nick = *argp++;
                                                char which[2] = {*p, 0};
                                                struct client_data *cl = findClient(nick);
                                                if (!cl) {
                                                        err_nosuchnick(client, nick), sendbuf(client);
-                                                       continue;
+                                                       break;
                                                }
                                                if (!trie_get(&chan->members, cl->key)) {
                                                        err_usernotinchannel(client, cl->nick, chan), sendbuf(client);
-                                                       continue;
+                                                       break;
                                                }
                                                trie_set(*p == 'o' ? &chan->o : &chan->v, cl->key, is_plus ? cl : NULL, NULL);
                                                copy_strf(&databuf, ":%s!%s@%s MODE %s %s%s %s\r\n",