[cvslog] [CVS] Module eggdrop1.8: Change committed

cvs at eggheads.org cvs at eggheads.org
Fri Jul 8 17:13:05 CST 2011


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.8
Commit time: 2011-07-08 23:13:04 UTC
Committer  : Thomas Sader <thommey at gmail.com>

Modified files:
     doc/Changes1.8 src/patch.h src/tclhash.c

Log message:

Fix Tcl8.5.10 memory corruption bug related to Tcl_ScanElement and Tcl_ConvertElement.

---------------------- diff included ----------------------
Index: eggdrop1.8/doc/Changes1.8
diff -u eggdrop1.8/doc/Changes1.8:1.52 eggdrop1.8/doc/Changes1.8:1.53
--- eggdrop1.8/doc/Changes1.8:1.52	Sun Mar 13 21:03:28 2011
+++ eggdrop1.8/doc/Changes1.8	Fri Jul  8 17:12:54 2011
@@ -1,4 +1,4 @@
-$Id: Changes1.8,v 1.52 2011/03/14 03:03:28 thommey Exp $
+$Id: Changes1.8,v 1.53 2011/07/08 23:12:54 thommey Exp $
 
 Eggdrop Changes (since version 1.8.0)
 
@@ -6,6 +6,11 @@
 
 1.8.0 (CVS):
 
+  - Make sure to account for null termination when using Tcl_ScanElement
+    to generate a string representation of a list using Tcl_ConvertElement.
+    A behavioural change in Tcl8.5.10 revealed this bug.
+    Found by: various / Patch by: thommey
+
   - Moved variable declarations to conform to C89 (beginning of blocks only).
     Found by: Anon-e-mouse / Patch by: thommey
 
Index: eggdrop1.8/src/patch.h
diff -u eggdrop1.8/src/patch.h:1.35 eggdrop1.8/src/patch.h:1.36
--- eggdrop1.8/src/patch.h:1.35	Sat Feb 26 13:22:37 2011
+++ eggdrop1.8/src/patch.h	Fri Jul  8 17:12:54 2011
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.35 2011/02/26 19:22:37 thommey Exp $
+ * $Id: patch.h,v 1.36 2011/07/08 23:12:54 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1298748085");            /* current unixtime */
+patch("1310166721");            /* current unixtime */
 /*
  *
  *
  */
-patch("publistennoident");
+patch("tclliststr");
 /*
  *
  *
Index: eggdrop1.8/src/tclhash.c
diff -u eggdrop1.8/src/tclhash.c:1.4 eggdrop1.8/src/tclhash.c:1.5
--- eggdrop1.8/src/tclhash.c:1.4	Wed Jan 26 19:41:08 2011
+++ eggdrop1.8/src/tclhash.c	Fri Jul  8 17:12:54 2011
@@ -7,7 +7,7 @@
  *   (non-Tcl) procedure lookups for msg/dcc/file commands
  *   (Tcl) binding internal procedures to msg/dcc/file commands
  *
- * $Id: tclhash.c,v 1.4 2011/01/27 01:41:08 thommey Exp $
+ * $Id: tclhash.c,v 1.5 2011/07/08 23:12:54 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1316,7 +1316,7 @@
   for (i = 0; cc[i].name; i++) {
     egg_snprintf(p, sizeof p, "*%s:%s", tl->name,
                  cc[i].funcname ? cc[i].funcname : cc[i].name);
-    l = nmalloc(Tcl_ScanElement(p, &k));
+    l = nmalloc(Tcl_ScanElement(p, &k) + 1);
     Tcl_ConvertElement(p, l, k | TCL_DONT_USE_BRACES);
     table[0].cdata = (void *) cc[i].func;
     add_cd_tcl_cmds(table);
@@ -1334,7 +1334,7 @@
   for (i = 0; cc[i].name; i++) {
     egg_snprintf(p, sizeof p, "*%s:%s", table->name,
                  cc[i].funcname ? cc[i].funcname : cc[i].name);
-    l = nmalloc(Tcl_ScanElement(p, &k));
+    l = nmalloc(Tcl_ScanElement(p, &k) + 1);
     Tcl_ConvertElement(p, l, k | TCL_DONT_USE_BRACES);
     Tcl_DeleteCommand(interp, p);
     unbind_bind_entry(table, cc[i].flags, cc[i].name, l);
----------------------- End of diff -----------------------


More information about the Changes mailing list