From ddaf04053beec2c9bbb63e1d9b99efdb6aabbf4e Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Mon, 27 Jun 2016 14:23:15 -0400 Subject: Fixed bug #73237 If the response includes both fields with simple types (which get concatenated into an XML string) and a complex type (which is parsed into an object), then the object will parsed into the same zval as the simple types and will overwrite the string. (cherry picked from commit 26287132c0c48e52dbaf1ac44c1d2f0d0d9b0cf7) --- ext/soap/php_encoding.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ext/soap/php_encoding.c') diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index a8f28fbf1e..c0e22d741b 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -1225,7 +1225,7 @@ static void unset_zval_property(zval* object, char* name) static void model_to_zval_any(zval *ret, xmlNodePtr node) { - zval rv, arr, val; + zval rv, arr, val, keepVal; zval* any = NULL; char* name = NULL; @@ -1254,6 +1254,7 @@ static void model_to_zval_any(zval *ret, xmlNodePtr node) ZVAL_NULL(&val2); master_to_zval(&val2, get_conversion(XSD_ANYXML), node->next); if (Z_TYPE(val2) != IS_STRING || *Z_STRVAL(val) != '<') { + Z_TRY_DELREF(val2); break; } concat_function(&val, &val, &val2); @@ -1272,7 +1273,8 @@ static void model_to_zval_any(zval *ret, xmlNodePtr node) any = &arr; name = NULL; } else { - any = &val; + ZVAL_COPY_VALUE(&keepVal, &val); + any = &keepVal; } } else { /* Add array element */ -- cgit v1.2.1