Created
January 25, 2016 10:14
-
-
Save tony2001/2af4b091e967f4b38e7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c | |
index 5d9064a..1fdc5a8 100644 | |
--- a/ext/soap/php_encoding.c | |
+++ b/ext/soap/php_encoding.c | |
@@ -3014,7 +3014,11 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP | |
xmlFreeNode(dummy); | |
} ZEND_HASH_FOREACH_END(); | |
smart_str_0(&list); | |
- xmlNodeSetContentLen(ret, BAD_CAST(ZSTR_VAL(list.s)), ZSTR_LEN(list.s)); | |
+ if (list.s) { | |
+ xmlNodeSetContentLen(ret, BAD_CAST(ZSTR_VAL(list.s)), ZSTR_LEN(list.s)); | |
+ } else { | |
+ xmlNodeSetContentLen(ret, BAD_CAST(""), 0); | |
+ } | |
smart_str_free(&list); | |
} else { | |
zval tmp; | |
@@ -3054,7 +3058,11 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP | |
start = next; | |
} | |
smart_str_0(&list); | |
- xmlNodeSetContentLen(ret, BAD_CAST(ZSTR_VAL(list.s)), ZSTR_LEN(list.s)); | |
+ if (list.s) { | |
+ xmlNodeSetContentLen(ret, BAD_CAST(ZSTR_VAL(list.s)), ZSTR_LEN(list.s)); | |
+ } else { | |
+ xmlNodeSetContentLen(ret, BAD_CAST(""), 0); | |
+ } | |
smart_str_free(&list); | |
efree(str); | |
if (data == &tmp) {zval_dtor(&tmp);} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment