summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-05-10 10:20:58 +0000
committerDmitry Stogov <dmitry@php.net>2005-05-10 10:20:58 +0000
commitbd996f23f2b6a461770b7bf7a1f38a1200d088ca (patch)
tree0cbb9ebc6bef21411d3a8636fb7c017228fc1a65
parent61ba13bf728c6a07cb3b99c03060ae7bea7787e3 (diff)
downloadphp-git-bd996f23f2b6a461770b7bf7a1f38a1200d088ca.tar.gz
Fixed SIGSEGV
-rw-r--r--ext/soap/php_http.c2
-rw-r--r--ext/soap/soap.c15
2 files changed, 16 insertions, 1 deletions
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;