summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/soap/php_sdl.c42
-rw-r--r--ext/soap/soap.c8
-rw-r--r--ext/soap/tests/bugs/bug54911.phpt2
3 files changed, 33 insertions, 19 deletions
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index faafdecee7..8de779a5f7 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -2426,7 +2426,7 @@ static void make_persistent_sdl_encoder_ref(encodePtr *enc, HashTable *ptr_map,
if ((tmp = zend_hash_str_find_ptr(ptr_map, (char *)enc, sizeof(encodePtr))) != NULL) {
*enc = tmp;
} else {
- zend_hash_next_index_insert_ptr(bp_encoders, *enc);
+ zend_hash_next_index_insert_ptr(bp_encoders, enc);
}
}
@@ -2472,7 +2472,8 @@ static HashTable* make_persistent_sdl_function_headers(HashTable *headers, HashT
}
if (key) {
- zend_hash_add_ptr(pheaders, key, pheader);
+ /* We have to duplicate key emalloc->malloc */
+ zend_hash_str_add_ptr(pheaders, key->val, key->len, pheader);
} else {
zend_hash_next_index_insert_ptr(pheaders, pheader);
}
@@ -2528,7 +2529,8 @@ static HashTable* make_persistent_sdl_parameters(HashTable *params, HashTable *p
}
if (key) {
- zend_hash_add_ptr(pparams, key, pparam);
+ /* We have to duplicate key emalloc->malloc */
+ zend_hash_str_add_ptr(pparams, key->val, key->len, pparam);
} else {
zend_hash_next_index_insert_ptr(pparams, pparam);
}
@@ -2571,7 +2573,8 @@ static HashTable* make_persistent_sdl_function_faults(sdlFunctionPtr func, HashT
}
if (key) {
- zend_hash_add_ptr(pfaults, key, pfault);
+ /* We have to duplicate key emalloc->malloc */
+ zend_hash_str_add_ptr(pfaults, key->val, key->len, pfault);
} else {
zend_hash_next_index_insert_ptr(pfaults, pfault);
}
@@ -2631,7 +2634,8 @@ static sdlAttributePtr make_persistent_sdl_attribute(sdlAttributePtr attr, HashT
pextra->val = strdup(tmp->val);
}
- zend_hash_add_ptr(pattr->extraAttributes, key, pextra);
+ /* We have to duplicate key emalloc->malloc */
+ zend_hash_str_add_ptr(pattr->extraAttributes, key->val, key->len, pextra);
}
} ZEND_HASH_FOREACH_END();
}
@@ -2774,7 +2778,8 @@ static sdlTypePtr make_persistent_sdl_type(sdlTypePtr type, HashTable *ptr_map,
ZEND_HASH_FOREACH_STR_KEY_PTR(type->elements, key, tmp) {
pelem = make_persistent_sdl_type(tmp, ptr_map, bp_types, bp_encoders);
if (key) {
- zend_hash_add_ptr(ptype->elements, key, pelem);
+ /* We have to duplicate key emalloc->malloc */
+ zend_hash_str_add_ptr(ptype->elements, key->val, key->len, pelem);
} else {
zend_hash_next_index_insert_ptr(ptype->elements, pelem);
}
@@ -2791,7 +2796,8 @@ static sdlTypePtr make_persistent_sdl_type(sdlTypePtr type, HashTable *ptr_map,
ZEND_HASH_FOREACH_STR_KEY_PTR(type->attributes, key, tmp) {
pattr = make_persistent_sdl_attribute(tmp, ptr_map, bp_types, bp_encoders);
if (key) {
- zend_hash_add_ptr(ptype->attributes, key, pattr);
+ /* We have to duplicate key emalloc->malloc */
+ zend_hash_str_add_ptr(ptype->attributes, key->val, key->len, pattr);
} else {
zend_hash_next_index_insert_ptr(ptype->attributes, pattr);
}
@@ -2942,7 +2948,8 @@ static sdlPtr make_persistent_sdl(sdlPtr sdl TSRMLS_DC)
ZEND_HASH_FOREACH_STR_KEY_PTR(sdl->groups, key, tmp) {
ptype = make_persistent_sdl_type(tmp, &ptr_map, &bp_types, &bp_encoders);
if (key) {
- zend_hash_add_ptr(psdl->groups, key, ptype);
+ /* We have to duplicate key emalloc->malloc */
+ zend_hash_str_add_ptr(psdl->groups, key->val, key->len, ptype);
} else {
zend_hash_next_index_insert_ptr(psdl->groups, ptype);
}
@@ -2960,7 +2967,8 @@ static sdlPtr make_persistent_sdl(sdlPtr sdl TSRMLS_DC)
ZEND_HASH_FOREACH_STR_KEY_PTR(sdl->types, key, tmp) {
ptype = make_persistent_sdl_type(tmp, &ptr_map, &bp_types, &bp_encoders);
if (key) {
- zend_hash_add_ptr(psdl->types, key, ptype);
+ /* We have to duplicate key emalloc->malloc */
+ zend_hash_str_add_ptr(psdl->types, key->val, key->len, ptype);
} else {
zend_hash_next_index_insert_ptr(psdl->types, ptype);
}
@@ -2978,7 +2986,8 @@ static sdlPtr make_persistent_sdl(sdlPtr sdl TSRMLS_DC)
ZEND_HASH_FOREACH_STR_KEY_PTR(sdl->elements, key, tmp) {
ptype = make_persistent_sdl_type(tmp, &ptr_map, &bp_types, &bp_encoders);
if (key) {
- zend_hash_add_ptr(psdl->elements, key, ptype);
+ /* We have to duplicate key emalloc->malloc */
+ zend_hash_str_add_ptr(psdl->elements, key->val, key->len, ptype);
} else {
zend_hash_next_index_insert_ptr(psdl->elements, ptype);
}
@@ -2996,7 +3005,8 @@ static sdlPtr make_persistent_sdl(sdlPtr sdl TSRMLS_DC)
ZEND_HASH_FOREACH_STR_KEY_PTR(sdl->encoders, key, tmp) {
penc = make_persistent_sdl_encoder(tmp, &ptr_map, &bp_types, &bp_encoders);
if (key) {
- zend_hash_add_ptr(psdl->encoders, key, penc);
+ /* We have to duplicate key emalloc->malloc */
+ zend_hash_str_add_ptr(psdl->encoders, key->val, key->len, penc);
} else {
zend_hash_next_index_insert_ptr(psdl->encoders, penc);
}
@@ -3037,7 +3047,8 @@ static sdlPtr make_persistent_sdl(sdlPtr sdl TSRMLS_DC)
ZEND_HASH_FOREACH_STR_KEY_PTR(sdl->bindings, key, tmp) {
pbind = make_persistent_sdl_binding(tmp, &ptr_map);
if (key) {
- zend_hash_add_ptr(psdl->bindings, key, pbind);
+ /* We have to duplicate key emalloc->malloc */
+ zend_hash_str_add_ptr(psdl->bindings, key->val, key->len, pbind);
} else {
zend_hash_next_index_insert_ptr(psdl->bindings, pbind);
}
@@ -3053,7 +3064,8 @@ static sdlPtr make_persistent_sdl(sdlPtr sdl TSRMLS_DC)
ZEND_HASH_FOREACH_STR_KEY_PTR(&sdl->functions, key, tmp) {
pfunc = make_persistent_sdl_function(tmp, &ptr_map);
if (key) {
- zend_hash_add_ptr(&psdl->functions, key, pfunc);
+ /* We have to duplicate key emalloc->malloc */
+ zend_hash_str_add_ptr(&psdl->functions, key->val, key->len, pfunc);
} else {
zend_hash_next_index_insert_ptr(&psdl->functions, pfunc);
}
@@ -3077,7 +3089,8 @@ static sdlPtr make_persistent_sdl(sdlPtr sdl TSRMLS_DC)
//???
Z_PTR_P(zv) = preq;
if (key) {
- zend_hash_add_ptr(psdl->requests, key, preq);
+ /* We have to duplicate key emalloc->malloc */
+ zend_hash_str_add_ptr(psdl->requests, key->val, key->len, preq);
}
} ZEND_HASH_FOREACH_END();
}
@@ -3135,6 +3148,7 @@ static void delete_psdl_int(sdl_cache_bucket *p)
static void delete_psdl(zval *zv)
{
delete_psdl_int(Z_PTR_P(zv));
+ free(Z_PTR_P(zv));
}
sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index d069d58bab..9660c32e24 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -2168,7 +2168,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
#ifdef va_copy
va_list argcopy;
#endif
-//??? zend_object_store_bucket *old_objects;
+ zend_object **old_objects;
int old = PG(display_errors);
//??? INIT_ZVAL(outbuf);
@@ -2192,8 +2192,8 @@ static void soap_error_handler(int error_num, const char *error_filename, const
Z_ADDREF(fault);
zend_throw_exception_object(&fault TSRMLS_CC);
-//??? old_objects = EG(objects_store).object_buckets;
-//??? EG(objects_store).object_buckets = NULL;
+ 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 {
@@ -2208,7 +2208,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
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;
+ EG(objects_store).object_buckets = old_objects;
PG(display_errors) = old;
zend_bailout();
} else if (!use_exceptions ||
diff --git a/ext/soap/tests/bugs/bug54911.phpt b/ext/soap/tests/bugs/bug54911.phpt
index da57383ac7..1a2d6eeb7e 100644
--- a/ext/soap/tests/bugs/bug54911.phpt
+++ b/ext/soap/tests/bugs/bug54911.phpt
@@ -15,7 +15,7 @@ Bug #54911 (Access to a undefined member in inherit SoapClient may cause Segment
--EXPECTF--
Fatal error: Uncaught SoapFault exception: [Client] Access to undeclared static property: XSoapClient::$crash in %sbug54911.php:4
Stack trace:
-#0 %sbug54911.php(4): XSoapClient::__doRequest()
+#0 %sbug54911.php(4): XSoapClient->__doRequest()
#1 [internal function]: XSoapClient->__doRequest('<?xml version="...', '', '#', 1, 0)
#2 %sbug54911.php(8): SoapClient->__soapCall('', Array)
#3 {main}