From: wessels <> Date: Tue, 18 Dec 2001 01:01:54 +0000 (+0000) Subject: When I rewrote _db_print a few months ago I created a problem for X-Git-Tag: SQUID_3_0_PRE1~1246 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=380de6f3d58dcd7dd070ae220c359678d89ddc3b;p=thirdparty%2Fsquid.git When I rewrote _db_print a few months ago I created a problem for ctx_print(). _db_print_file() might be called recursively in the stack and cause a coredump relating to varargs. This patch moves the ctx_print() call into _db_print() and before we start processing the varargs stuff. --- diff --git a/src/debug.cc b/src/debug.cc index 323d612549..539f8c9967 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1,6 +1,6 @@ /* - * $Id: debug.cc,v 1.83 2001/06/29 21:16:42 wessels Exp $ + * $Id: debug.cc,v 1.84 2001/12/17 18:01:54 wessels Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -60,12 +60,18 @@ _db_print(va_alist) #if STDC_HEADERS va_list args2; va_list args3; +#else +#define args2 args1 +#define args3 args1 +#endif + /* give a chance to context-based debugging to print current context */ + if (!Ctx_Lock) + ctx_print(); +#if STDC_HEADERS va_start(args1, format); va_start(args2, format); va_start(args3, format); #else -#define args2 args1 -#define args3 args1 format = va_arg(args1, const char *); #endif snprintf(f, BUFSIZ, "%s| %s",