1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 01:48:26 +02:00

Fixed SIGSEGV during error processing on some systems (linux/ppc)

This commit is contained in:
Dmitry Stogov
2005-07-06 06:59:07 +00:00
parent 8fe2b1bed4
commit 342e04ca80
+9
View File
@@ -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;