From: Stanislav Malyshev Date: Mon, 6 Dec 2004 15:50:27 +0000 (+0000) Subject: port fix for #30998: Crash when user error handler returns false on amd64 X-Git-Tag: RELEASE_0_2~568 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e9c193e1bf9c88b87e0a567d182a3ee03f054ce;p=php port fix for #30998: Crash when user error handler returns false on amd64 --- diff --git a/Zend/zend.c b/Zend/zend.c index 97dfcd3a91..7737280c0a 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -874,6 +874,7 @@ ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval ZEND_API void zend_error(int type, const char *format, ...) { va_list args; + va_list usr_copy; zval ***params; zval *retval; zval *z_error_type, *z_error_message, *z_error_filename, *z_error_lineno, *z_context; @@ -943,7 +944,15 @@ ZEND_API void zend_error(int type, const char *format, ...) ALLOC_INIT_ZVAL(z_error_lineno); ALLOC_INIT_ZVAL(z_context); - z_error_message->value.str.len = zend_vspprintf(&z_error_message->value.str.val, 0, format, args); +#if defined(va_copy) + va_copy(usr_copy, args); +#else + usr_copy = args; +#endif + z_error_message->value.str.len = zend_vspprintf(&z_error_message->value.str.val, 0, format, usr_copy); +#if defined(va_copy) + va_end(usr_copy); +#endif z_error_message->type = IS_STRING; z_error_type->value.lval = type;