From 342e04ca8060b17cb2940ad5ddea373e853453fd Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 6 Jul 2005 06:59:07 +0000 Subject: [PATCH] Fixed SIGSEGV during error processing on some systems (linux/ppc) --- ext/soap/soap.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 7524f7bdc5..2efc6356c6 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -23,7 +23,9 @@ #include "config.h" #endif #include "php_soap.h" +#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION) #include "ext/session/php_session.h" +#endif #ifdef ZEND_ENGINE_2 # include "zend_exceptions.h" #endif @@ -1937,6 +1939,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const int old = PG(display_errors); int fault = 0; zval fault_obj; + va_list argcopy; if (error_num == E_USER_ERROR || error_num == E_COMPILE_ERROR || @@ -1952,7 +1955,13 @@ static void soap_error_handler(int error_num, const char *error_filename, const INIT_ZVAL(outbuflen); +#ifdef va_copy + va_copy(argcopy, args); + buffer_len = vsnprintf(buffer, sizeof(buffer)-1, format, argcopy); + va_end(argcopy); +#else buffer_len = vsnprintf(buffer, sizeof(buffer)-1, format, args); +#endif buffer[sizeof(buffer)-1]=0; if (buffer_len > sizeof(buffer) - 1 || buffer_len < 0) { buffer_len = sizeof(buffer) - 1; -- 2.40.0