[eggheads-patches] PATCH: addbtab.patch

Peter 'Rattacresh' Backes rtc at rhrk.uni-kl.de
Wed Oct 6 15:39:25 CST 1999


ASSERT instead of SEGV crash if add_bind_table called with name > 5 
chars. 
Requires assert.patch.


-- Peter 'Rattacresh' Backes, rtc at rhrk.uni-kl.de

-------------- next part --------------
diff -urN eggdrop1.3.29/doc/UPDATES1.3 eggdrop1.3.29+addbtab/doc/UPDATES1.3
--- eggdrop1.3.29/doc/UPDATES1.3	Wed Oct  6 22:10:47 1999
+++ eggdrop1.3.29+addbtab/doc/UPDATES1.3	Wed Oct  6 22:14:43 1999
@@ -4,6 +4,7 @@
 
 1.3.29
 Foundby   Fixedby   What....
+          rtc       add_bind_table could write to write only segment
 	  arthur2   duplicate entries removed from core.english.lang.
 Beige	  Fabian    killsock() could accidently free unused socket entries
           Tothwolf/ fixed way we get version number for Tcl_PkgProvide()
diff -urN eggdrop1.3.29/src/tclhash.c eggdrop1.3.29+addbtab/src/tclhash.c
--- eggdrop1.3.29/src/tclhash.c	Wed Oct  6 22:10:47 1999
+++ eggdrop1.3.29+addbtab/src/tclhash.c	Wed Oct  6 22:09:39 1999
@@ -119,8 +119,11 @@
 {
   p_tcl_bind_list p = bind_table_list, o = NULL;
 
-  if (strlen(nme) > 4)
-    nme[4] = 0;
+  /* Do not allow coders to use bind table names longer than
+   * 4 characters.
+   */
+  ASSERT (strlen(nme) <= 4); 
+
   while (p) {
     int v = strcasecmp(p->name, nme);
 


More information about the Patches mailing list