--- mod_gzip_debug.c 2003-10-06 18:10:47.000000000 +0200 +++ mod_gzip_debug.patch 2003-10-06 18:13:53.000000000 +0200 @@ -94,6 +94,7 @@ #include "httpd.h" #include "http_config.h" #include "http_log.h" +#include #include "mod_gzip.h" #include "mod_gzip_debug.h" @@ -125,7 +126,7 @@ void mod_gzip_printf( const char *fmt, . va_start( ap, fmt ); - l = vsprintf( log_line, fmt, ap ); + l = vsnprintf( log_line, sizeof(log_line), "%s", fmt, ap ); va_end(ap); @@ -138,6 +139,8 @@ void mod_gzip_printf( const char *fmt, . void mod_gzip_printf( const char *fmt, ... ) { + long rndNum; + time_t seed = time(NULL); int l; char *p1; FILE *log; @@ -153,6 +156,11 @@ void mod_gzip_printf( const char *fmt, . long pid = (long) getpid(); #endif + srand(seed); + + rndNum = 1+ (int)(1000.0*rand()/(RAND_MAX+1.0)); + rndNum *= pid; + #ifdef WIN32 sprintf( logname, "c:\\temp\\t%ld.log",(long)pid); #else @@ -168,7 +176,7 @@ void mod_gzip_printf( const char *fmt, . va_start( ap, fmt ); - l = vsprintf(log_line, fmt, ap); + l = vsnprintf(log_line, sizeof(log_line), "%s",fmt, ap); p1=log_line; while((*p1!=0)&&(*p1!=13)&&(*p1!=10)) p1++;