1
0
Эх сурвалжийг харах

* Ported [2950] to 1.2.11
* Fixed a segfault from removing bots. (fixes #271)


svn: 2951

Bryan Drewery 20 жил өмнө
parent
commit
dc4575b10d
2 өөрчлөгдсөн 7 нэмэгдсэн , 1 устгасан
  1. 1 0
      doc/UPDATES
  2. 6 1
      src/userrec.c

+ 1 - 0
doc/UPDATES

@@ -12,6 +12,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Disabled watcher feature.
 * Fixed problems with symlinked binaries. (fixes #240)
 * Fixed CIDR masks not being checked on JOIN. (also fixes some other cases of CIDR matching) (fixes #270)
+* Fixed a segfault from removing bots. (fixes #271)
 
 1.2.10 - http://tracker.shatow.net/milestone/1.2.10
 * Removed old references to '+/-manop' and '+/-nomop' for chaninfo in help file.

+ 6 - 1
src/userrec.c

@@ -642,10 +642,15 @@ int deluser(char *handle)
     shareout("k %s\n", handle);
   for (fnd = 0; fnd < dcc_total; fnd++) {
     if (dcc[fnd].type && dcc[fnd].user == u) {
-      if (conf.bot->hub && u->bot) {
+      if (u->bot) {
         int i = nextbot(handle);
+
         if (i != -1 && !egg_strcasecmp(dcc[i].nick, handle))
           botunlink(-1, handle, "Bot removed.");
+        else { /* This will probably never be called -- but just in case */
+          killsock(dcc[fnd].sock);
+          lostdcc(fnd);
+        }
       } else if (!u->bot) {
         dprintf(fnd, "-+- POOF! -+-\n");
         dprintf(fnd, "You are no longer a user on this botnet.\n");