diff options
author | Remi Collet <remi@php.net> | 2015-11-19 08:18:13 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2015-11-19 17:20:28 +0100 |
commit | 0e2d72560af686204e12cf55a7e49240d8a2a9e0 (patch) | |
tree | e0697b08e0a85ae0fbda3fd205b2e194da344926 | |
parent | 62ef34da4eebd8b75d8ec35c0209d373ae1dd68c (diff) | |
download | php-git-0e2d72560af686204e12cf55a7e49240d8a2a9e0.tar.gz |
Fixed bug #70940 Segfault in soep / type_to_string
-rw-r--r-- | ext/soap/soap.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 6da617a983..4c746aaf29 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -4802,7 +4802,9 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) enc = enc->details.sdl_type->encode; } if (enc) { - smart_str_appendl(buf, ZSTR_VAL(spaces.s), ZSTR_LEN(spaces.s)); + if (spaces.s) { + smart_str_appendl(buf, ZSTR_VAL(spaces.s), ZSTR_LEN(spaces.s)); + } smart_str_appendc(buf, ' '); smart_str_appendl(buf, type->encode->details.type_str, strlen(type->encode->details.type_str)); smart_str_appendl(buf, " _;\n", 4); @@ -4815,7 +4817,9 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) sdlAttributePtr attr; ZEND_HASH_FOREACH_PTR(type->attributes, attr) { - smart_str_appendl(buf, ZSTR_VAL(spaces.s), ZSTR_LEN(spaces.s)); + if (spaces.s) { + smart_str_appendl(buf, ZSTR_VAL(spaces.s), ZSTR_LEN(spaces.s)); + } smart_str_appendc(buf, ' '); if (attr->encode && attr->encode->details.type_str) { smart_str_appends(buf, attr->encode->details.type_str); |