]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
When I rewrote _db_print a few months ago I created a problem for
authorwessels <>
Tue, 18 Dec 2001 01:01:54 +0000 (01:01 +0000)
committerwessels <>
Tue, 18 Dec 2001 01:01:54 +0000 (01:01 +0000)
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.

src/debug.cc

index 323d61254939ad24cb6a970915cf08858e7bbe68..539f8c9967e158926529f68413b1355cab66ebc1 100644 (file)
@@ -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",