[cvslog] (2005-09-04 18:54:08 UTC) Module eggdrop1.6: Change committed!

cvslog cvs at tsss.org
Sun Sep 4 12:54:08 CST 2005


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2005-09-04 18:54:08 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     doc/UPDATES1.6 src/botnet.c src/patch.h

Log message:

- Fixed possibility of referencing a NULL pointer in rembot().
* Patch by: lordares

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.620 eggdrop1.6/doc/UPDATES1.6:1.621
--- eggdrop1.6/doc/UPDATES1.6:1.620	Mon Aug 29 18:44:33 2005
+++ eggdrop1.6/doc/UPDATES1.6	Sun Sep  4 13:53:58 2005
@@ -1,4 +1,4 @@
-$Id: UPDATES1.6,v 1.620 2005/08/29 23:44:33 wcc Exp $
+$Id: UPDATES1.6,v 1.621 2005/09/04 18:53:58 wcc Exp $
 
 Eggdrop Changes (since v1.6.0)
     _____________________________________________________________________
@@ -12,12 +12,9 @@
 
 
   1.6.18:
+    - Fixed possibility of referencing a NULL pointer in rembot().
     - Added a missing param cast for dcc_table.timeout.
-    * Patch by: lordares
-
     - Fixed a memleak / other nasty stuff when MODES_PER_LINE_MAX != 6.
-    * Patch by: lordares
-
     - Fixed putlog() of an uninitialized (and incorrect) variable in
       dcc_telnet_hostresolved().
     * Patch by: lordares
Index: eggdrop1.6/src/botnet.c
diff -u eggdrop1.6/src/botnet.c:1.58 eggdrop1.6/src/botnet.c:1.59
--- eggdrop1.6/src/botnet.c:1.58	Mon Jan  3 14:01:44 2005
+++ eggdrop1.6/src/botnet.c	Sun Sep  4 13:53:58 2005
@@ -7,7 +7,7 @@
  *   linking, unlinking, and relaying to another bot
  *   pinging the bots periodically and checking leaf status
  *
- * $Id: botnet.c,v 1.58 2005/01/03 20:01:44 paladin Exp $
+ * $Id: botnet.c,v 1.59 2005/09/04 18:53:58 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -288,21 +288,29 @@
   }
 }
 
-/* Remove a tandem bot from the chain list
- */
-void rembot(char *who)
+/* Remove a tandem bot from the chain list. */
+void rembot(char *whoin)
 {
   tand_t **ptr = &tandbot, *ptr2;
   struct userrec *u;
+  char *who = NULL;
+  size_t len = 0;
+
+  /* Need to save the nick for later as it MAY be a pointer to ptr->bot, and we free(ptr) in here. */
+  len = strlen(whoin);
+  who = nmalloc(len + 1);
+  strncpyz(who, whoin, len + 1);
 
   while (*ptr) {
     if (!egg_strcasecmp((*ptr)->bot, who))
       break;
     ptr = &((*ptr)->next);
   }
-  if (!*ptr)
-    /* May have just .unlink *'d */
+  if (!*ptr) {
+    /* May have just .unlink *'d. */
+    nfree(who);
     return;
+  }
   check_tcl_disc(who);
 
   u = get_user_by_handle(userlist, who);
@@ -315,6 +323,7 @@
   tands--;
 
   dupwait_notify(who);
+  nfree(who);
 }
 
 void remparty(char *bot, int sock)
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.1169 eggdrop1.6/src/patch.h:1.1170
--- eggdrop1.6/src/patch.h:1.1169	Wed Aug 31 21:23:49 2005
+++ eggdrop1.6/src/patch.h	Sun Sep  4 13:53:58 2005
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.1169 2005/09/01 02:23:49 wcc Exp $
+ * $Id: patch.h,v 1.1170 2005/09/04 18:53:58 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1125541348");            /* current unixtime */
+patch("1125860044");            /* current unixtime */
 /*
  *
  *
  */
-patch("DCC_CHAT-fixes");
+patch("rembot");
 /*
  *
  *
----------------------- End of diff -----------------------



More information about the Changes mailing list