com php-src: Fix assertion failure in SoapFault ctor: ext/soap/soap.c
| From: | Nikita Popov | Date: | Tue, 05 Sep 2017 15:38:50 +0000 |
| Subject: | com php-src: Fix assertion failure in SoapFault ctor: ext/soap/soap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99271@lists.php.net to get a copy of this message | ||
Commit: dc00b6cf3f08835d4ad4275123a083bd390983c9
Author: Nikita Popov <nikita.ppv@gmail.com> Tue, 5 Sep 2017 17:38:50 +0200
Parents: 056df0dcb22a7654beb969765db3264eed37dc90
Branches: PHP-7.2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=dc00b6cf3f08835d4ad4275123a083bd390983c9
Log:
Fix assertion failure in SoapFault ctor
Resetting the IAP on a shared array violates COW. I'm replacing this
with code to look up indexes 0 and 1, even though this is not
strictly the same.
Changed paths:
M ext/soap/soap.c
Diff:
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 32cc648..3c7e847 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -891,16 +891,12 @@ PHP_METHOD(SoapFault, SoapFault)
fault_code = Z_STRVAL_P(code);
fault_code_len = Z_STRLEN_P(code);
} else if (Z_TYPE_P(code) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(code)) == 2) {
- zval *t_ns, *t_code;
-
- zend_hash_internal_pointer_reset(Z_ARRVAL_P(code));
- t_ns = zend_hash_get_current_data(Z_ARRVAL_P(code));
- zend_hash_move_forward(Z_ARRVAL_P(code));
- t_code = zend_hash_get_current_data(Z_ARRVAL_P(code));
- if (Z_TYPE_P(t_ns) == IS_STRING && Z_TYPE_P(t_code) == IS_STRING) {
- fault_code_ns = Z_STRVAL_P(t_ns);
- fault_code = Z_STRVAL_P(t_code);
- fault_code_len = Z_STRLEN_P(t_code);
+ zval *t_ns = zend_hash_index_find(Z_ARRVAL_P(code), 0);
+ zval *t_code = zend_hash_index_find(Z_ARRVAL_P(code), 1);
+ if (t_ns && t_code && Z_TYPE_P(t_ns) == IS_STRING && Z_TYPE_P(t_code) ==
IS_STRING) {
+ fault_code_ns = Z_STRVAL_P(t_ns);
+ fault_code = Z_STRVAL_P(t_code);
+ fault_code_len = Z_STRLEN_P(t_code);
} else {
php_error_docref(NULL, E_WARNING, "Invalid fault code");
return;