Просмотр исходного кода

* Fixed segfault after booting users when a leaf has lost +c. (#18)

svn: 1964
Bryan Drewery 21 лет назад
Родитель
Сommit
9fe0d46aed
2 измененных файлов с 5 добавлено и 1 удалено
  1. 1 0
      doc/UPDATES
  2. 4 1
      src/cmds.c

+ 1 - 0
doc/UPDATES

@@ -54,6 +54,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed, or
 * Added cmd_version (does same as .botversion)
 * Added cmd_version (does same as .botversion)
 * Fixed userfile becoming desynced during transfer; A bot downloading a userfile would miss changes made during the transfer. (#11)
 * Fixed userfile becoming desynced during transfer; A bot downloading a userfile would miss changes made during the transfer. (#11)
 * Fixed a problem with accepting new telnet connections.
 * Fixed a problem with accepting new telnet connections.
+* Fixed segfault after booting users when a leaf has lost +c. (#18)
 
 
 1.2.2
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 4 - 1
src/cmds.c

@@ -2141,9 +2141,10 @@ int check_dcc_attrs(struct userrec *u, flag_t oatr)
 
 
   for (int i = 0; i < dcc_total; i++) {
   for (int i = 0; i < dcc_total; i++) {
    if (dcc[i].type && !dcc[i].simul) {
    if (dcc[i].type && !dcc[i].simul) {
-    if (dcc[i].type && dcc[i].type == &DCC_CHAT && !conf.bot->hub && !ischanhub() && u == conf.bot->u) {
+    if (dcc[i].type == &DCC_CHAT && !conf.bot->hub && !ischanhub() && u == conf.bot->u) {
       dprintf(i, "I am no longer a chathub..\n\n");
       dprintf(i, "I am no longer a chathub..\n\n");
       do_boot(i, conf.bot->nick, "I am no longer a chathub.\n\n");
       do_boot(i, conf.bot->nick, "I am no longer a chathub.\n\n");
+      continue;
     }
     }
 
 
     if ((dcc[i].type->flags & DCT_MASTER) && (!egg_strcasecmp(u->handle, dcc[i].nick))) {
     if ((dcc[i].type->flags & DCT_MASTER) && (!egg_strcasecmp(u->handle, dcc[i].nick))) {
@@ -2223,12 +2224,14 @@ int check_dcc_attrs(struct userrec *u, flag_t oatr)
         dprintf(i, "-+- POOF! -+-\n");
         dprintf(i, "-+- POOF! -+-\n");
         dprintf(i, "You no longer have hub access.\n\n");
         dprintf(i, "You no longer have hub access.\n\n");
         do_boot(i, conf.bot->nick, "No hub access.\n\n");
         do_boot(i, conf.bot->nick, "No hub access.\n\n");
+        continue;
       }     
       }     
       if (!conf.bot->hub && ischanhub() && !(u->flags & (USER_CHUBA))) {
       if (!conf.bot->hub && ischanhub() && !(u->flags & (USER_CHUBA))) {
         /* no chanhub access, drop them. */
         /* no chanhub access, drop them. */
         dprintf(i, "-+- POOF! -+-\n");
         dprintf(i, "-+- POOF! -+-\n");
         dprintf(i, "You no longer have chathub access.\n\n");
         dprintf(i, "You no longer have chathub access.\n\n");
         do_boot(i, conf.bot->nick, "No chathub access.\n\n");
         do_boot(i, conf.bot->nick, "No chathub access.\n\n");
+        continue;
       }
       }
     }
     }
    }
    }