com php-src: Fixed bug #70715 (Segmentation fault inside soap client): ext/soap/php_http.c
| From: | Anatol Belski | Date: | Fri, 23 Oct 2015 08:41:33 +0000 |
| Subject: | com php-src: Fixed bug #70715 (Segmentation fault inside soap client): ext/soap/php_http.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89518@lists.php.net to get a copy of this message | ||
Commit: 1f677c5eff7be05db478d4a67860a868058fedc6
Author: Xinchen Hui <laruence@gmail.com> Thu, 15 Oct 2015 18:46:57 +0800
Committer: Anatol Belski <ab@php.net> Fri, 23 Oct 2015 10:41:33 +0200
Parents: 959d93086a1f51bd256123cec4bbad5d4c84a94f
Branches: PHP-7.0.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1f677c5eff7be05db478d4a67860a868058fedc6
Log:
Fixed bug #70715 (Segmentation fault inside soap client)
Bugs:
https://bugs.php.net/70715
Changed paths:
M ext/soap/php_http.c
Diff:
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index 005d3af..b9e45f6 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -1494,7 +1494,11 @@ static zend_string* get_http_body(php_stream *stream, int close, char
*headers)
} else if (header_close) {
do {
int len_read;
- http_buf = zend_string_realloc(http_buf, http_buf_size + 4096 + 1, 0);
+ if (http_buf) {
+ http_buf = zend_string_realloc(http_buf, http_buf_size + 4096, 0);
+ } else {
+ http_buf = zend_string_alloc(4096, 0);
+ }
len_read = php_stream_read(stream, http_buf->val + http_buf_size, 4096);
if (len_read > 0) {
http_buf_size += len_read;