Quellcode durchsuchen

* Fix crash from setting a bot +B

This was caused by the bot ignoring JOINs and not calling newmember(),
then crashing if the member was opped via a cookie.
Bryan Drewery vor 16 Jahren
Ursprung
Commit
63a04439ed
2 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  1. 1 0
      doc/UPDATES
  2. 3 1
      src/mod/irc.mod/mode.c

+ 1 - 0
doc/UPDATES

@@ -80,6 +80,7 @@
   * Fix cmd_botjoin not properly setting up addedby/addedts for the channel.
   * Fix bots never timing out when connecting to servers sometimes.
   * Bot no longer tries opening an identd socket unless it's root or running on cygwin.
+  * Fix crash when setting a bot +B
 * Misc changes
   * Cleanup DCC/Telnet listening so bot only listens on IPV6 if it was specifically given an IPV6 IP.
   * CTCP bot CHAT will no longer work if the bot does not have an IPV4 IP set.

+ 3 - 1
src/mod/irc.mod/mode.c

@@ -1130,7 +1130,9 @@ gotmode(char *from, char *msg)
                */
               for (i = 0; i < (modecnt - 1); i++) { /* Don't need to hit the -b */
                 if (msign == '+' && mmode == 'o') {
-                  mv = ismember(chan, mparam);
+                  mv = assert_ismember(chan, mparam);
+                  // Unknown client - I am desycned, don't punish or it may lead to fight
+                  if (!mv) continue;
 
                   const char *cookie = &(modes[modecnt - 1][3]);
                   if ((isbadop = checkcookie(chan->dname, m, mv, cookie, i))) {