From 700f7bfc0c0a1ee5ca008568fc9114cdbf858b9c Mon Sep 17 00:00:00 2001 From: Anton Artamonov Date: Sat, 4 Nov 2017 19:51:33 +0700 Subject: [PATCH] Fixed bug #70469 when you can get fatal error from error_get_last() even if SoapClient is in exception mode --- ext/soap/soap.c | 23 ----------------------- ext/soap/tests/bugs/bug70469.phpt | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 23 deletions(-) create mode 100644 ext/soap/tests/bugs/bug70469.phpt diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 62b119fb2bfcf..bd46486d72b67 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -2167,11 +2167,6 @@ static void soap_error_handler(int error_num, const char *error_filename, const int buffer_len; #ifdef va_copy va_list argcopy; -#endif - zend_object **old_objects; - int old = PG(display_errors); - -#ifdef va_copy va_copy(argcopy, args); buffer_len = vslprintf(buffer, sizeof(buffer)-1, format, argcopy); va_end(argcopy); @@ -2189,24 +2184,6 @@ static void soap_error_handler(int error_num, const char *error_filename, const add_soap_fault_ex(&fault, &SOAP_GLOBAL(error_object), code, buffer, NULL, NULL); Z_ADDREF(fault); zend_throw_exception_object(&fault); - - old_objects = EG(objects_store).object_buckets; - EG(objects_store).object_buckets = NULL; - PG(display_errors) = 0; - SG(sapi_headers).http_status_line = NULL; - zend_try { - call_old_error_handler(error_num, error_filename, error_lineno, format, args); - } zend_catch { - CG(in_compilation) = _old_in_compilation; - EG(current_execute_data) = _old_current_execute_data; - if (SG(sapi_headers).http_status_line) { - efree(SG(sapi_headers).http_status_line); - } - SG(sapi_headers).http_status_line = _old_http_status_line; - SG(sapi_headers).http_response_code = _old_http_response_code; - } zend_end_try(); - EG(objects_store).object_buckets = old_objects; - PG(display_errors) = old; zend_bailout(); } else if (!use_exceptions || !SOAP_GLOBAL(error_code) || diff --git a/ext/soap/tests/bugs/bug70469.phpt b/ext/soap/tests/bugs/bug70469.phpt new file mode 100644 index 0000000000000..ca3ab80950df5 --- /dev/null +++ b/ext/soap/tests/bugs/bug70469.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #70469 (SoapClient should not generate E_ERROR if exceptions enabled) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +catched +ok \ No newline at end of file