[eggheads-patches] PATCH: flushlogs.patch

Fabian Knittel fknittel at gmx.de
Mon Oct 18 11:43:13 CST 1999


On Sun, Oct 17, 1999 at 11:39:01PM +0200, Fabian Knittel wrote:
> [ flushlogs.patch ]
> 
> This patch makes flushlogs() check if the logs system
> is initialised yet, before attempting to flush any
> messages.
> 
> If we caught a SEGV before initialising sockets and
> before initialising the logs stuff, the following chain
> resulted:
> 
>   SEGV -> write_debug() -> setsock() -> fatal() \
>   -> flushlogs() -> SEGV

Let's try this again. Patch applied.

Fabian

-------------- next part --------------
diff -urN eggdrop1.3~/doc/UPDATES1.3 eggdrop1.3/doc/UPDATES1.3
--- eggdrop1.3~/doc/UPDATES1.3	Wed Oct 13 00:36:49 1999
+++ eggdrop1.3/doc/UPDATES1.3	Wed Oct 13 19:21:27 1999
@@ -4,6 +4,7 @@
 
 1.3.29
 Foundby   Fixedby   What....
+Ian	  Fabian    flushlogs caused segv if called before init_misc()
 Tothwolf  Fabian    stopped userfile parsing funcs from messing with ~ and `
 	  CyberTech Fixed pver length into init_tcl().
 	  drummer   Adds ismodeline macros.
diff -urN eggdrop1.3~/src/misc.c eggdrop1.3/src/misc.c
--- eggdrop1.3~/src/misc.c	Tue Oct 12 22:16:11 1999
+++ eggdrop1.3/src/misc.c	Wed Oct 13 18:42:59 1999
@@ -591,6 +591,9 @@
   struct tm *T = localtime(&now);
 
   context;
+  /* logs may not be initialised yet.  (Fabian) */
+  if (!logs)
+    return;
   /* Now also checks to see if there's a repeat message and
    * displays the 'last message repeated...' stuff too <cybah> */
   for (i = 0; i < max_logs; i++) {


More information about the Patches mailing list