[eggheads-patches] PATCH: tclloopfix.patch

Fabian Knittel fknittel at gmx.de
Wed Oct 20 10:23:25 CST 1999


[ tclloopfix.patch ]

Fixes the .tcl banlist problem. The crash was probably
caused because people don't have unlimited memory.. hehe.

tcl_do_masklist() was looping infinitely, allocating
memory in each loop which caused the Tcl interpreter to
crash at one point. It only occured if the masklist had
at least one entry, that's probably the reason why only
banlist _seemed_ to cause the problem.

Fabian
-------------- next part --------------
diff -urN eggdrop1.3~/doc/UPDATES1.3 eggdrop1.3/doc/UPDATES1.3
--- eggdrop1.3~/doc/UPDATES1.3	Wed Oct 20 15:52:20 1999
+++ eggdrop1.3/doc/UPDATES1.3	Wed Oct 20 15:50:31 1999
@@ -4,6 +4,7 @@
 
 1.3.29
 Foundby   Fixedby   What....
+James	  Fabian    infinite loop in tcl_do_masklist()
 	  Fabian    bot was deop'ing itsself in got_op()
 	  drummer   tidy-up of write_channels()
 	  Tothwolf  various configure/Makefile changes again
diff -urN eggdrop1.3~/src/mod/channels.mod/tclchan.c eggdrop1.3/src/mod/channels.mod/tclchan.c
--- eggdrop1.3~/src/mod/channels.mod/tclchan.c	Tue Oct 19 20:41:39 1999
+++ eggdrop1.3/src/mod/channels.mod/tclchan.c	Wed Oct 20 15:48:37 1999
@@ -1118,9 +1118,6 @@
   char ts[21], ts1[21], ts2[21];
   char *list[6], *p;
 
-  if (!m)
-    return TCL_OK;
-    
   while (m) {
     list[0] = m->mask;
     list[1] = m->desc;
@@ -1134,6 +1131,7 @@
     p = Tcl_Merge(6, list);
     Tcl_AppendElement(irp, p);
     n_free(p, "", 0);
+    m = m->next;
   }
   
   return TCL_OK;  


More information about the Patches mailing list