From: Dmitry Stogov Date: Tue, 10 May 2005 10:20:38 +0000 (+0000) Subject: Fixed SIGSEGV X-Git-Tag: php-5.0.5RC1~301 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=909033e6508318a3a19c81d55e404fea6d0d24f0;p=php Fixed SIGSEGV --- diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 2de0e42237..9b3c21cc15 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -665,7 +665,7 @@ try_again: do { if (!get_http_headers(stream, &http_headers, &http_header_size TSRMLS_CC)) { - efree(http_headers); + if (http_headers) {efree(http_headers);} if (request != buf) {efree(request);} php_stream_close(stream); zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")); diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 7c2ea87a8b..787a8d509f 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -92,6 +92,9 @@ static void soap_error_handler(int error_num, const char *error_filename, const char* _old_error_code = SOAP_GLOBAL(error_code);\ zval* _old_error_object = SOAP_GLOBAL(error_object);\ int _old_soap_version = SOAP_GLOBAL(soap_version);\ + zend_bool _old_in_compilation = CG(in_compilation); \ + zend_bool _old_in_execution = EG(in_execution); \ + zend_execute_data *_old_current_execute_data = EG(current_execute_data); \ int _bailout = 0;\ SOAP_GLOBAL(use_soap_error_handler) = 1;\ SOAP_GLOBAL(error_code) = "Client";\ @@ -100,6 +103,9 @@ static void soap_error_handler(int error_num, const char *error_filename, const #define SOAP_CLIENT_END_CODE() \ } zend_catch {\ + CG(in_compilation) = _old_in_compilation; \ + EG(in_execution) = _old_in_execution; \ + EG(current_execute_data) = _old_current_execute_data; \ if (EG(exception) == NULL || \ Z_TYPE_P(EG(exception)) != IS_OBJECT || \ Z_OBJCE_P(EG(exception)) != soap_fault_class_entry) {\ @@ -1837,6 +1843,9 @@ static void soap_server_fault(char* code, char* string, char *actor, zval* detai static void soap_error_handler(int error_num, const char *error_filename, const uint error_lineno, const char *format, va_list args) { TSRMLS_FETCH(); + zend_bool _old_in_compilation = CG(in_compilation); + zend_bool _old_in_execution = EG(in_execution); + zend_execute_data *_old_current_execute_data = EG(current_execute_data); if (!SOAP_GLOBAL(use_soap_error_handler)) { old_error_handler(error_num, error_filename, error_lineno, format, args); @@ -1886,6 +1895,9 @@ static void soap_error_handler(int error_num, const char *error_filename, const zend_try { old_error_handler(error_num, error_filename, error_lineno, format, args); } zend_catch { + CG(in_compilation) = _old_in_compilation; + EG(in_execution) = _old_in_execution; + EG(current_execute_data) = _old_current_execute_data; } zend_end_try(); PG(display_errors) = old; zend_bailout(); @@ -1939,6 +1951,9 @@ static void soap_error_handler(int error_num, const char *error_filename, const zend_try { old_error_handler(error_num, error_filename, error_lineno, format, args); } zend_catch { + CG(in_compilation) = _old_in_compilation; + EG(in_execution) = _old_in_execution; + EG(current_execute_data) = _old_current_execute_data; } zend_end_try(); PG(display_errors) = old;