com php-src: Fixed bug #70940 Segfault in soep / type_to_st ring: ext/soap/soap.c
| From: | Remi Collet | Date: | Thu, 19 Nov 2015 07:18:13 +0000 |
| Subject: | com php-src: Fixed bug #70940 Segfault in soep / type_to_st ring: ext/soap/soap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89906@lists.php.net to get a copy of this message | ||
Commit: 6680c2b22edc635ae7a2ff26f0c2fe0990d2d1fe
Author: Remi Collet <remi@php.net> Thu, 19 Nov 2015 08:18:13 +0100
Parents: 4dee0c4a14a00f353d982a470694f907aa7f5239
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6680c2b22edc635ae7a2ff26f0c2fe0990d2d1fe
Log:
Fixed bug #70940 Segfault in soep / type_to_string
Bugs:
https://bugs.php.net/70940
Changed paths:
M ext/soap/soap.c
Diff:
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 6da617a..4c746aa 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);