From a2cfcdfbe9f9ee18388b8ca1d788f43373fec31a Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Thu, 15 Oct 2015 10:19:43 +0800 Subject: Fixed bug #70709 (SOAP Client generates Segfault) --- ext/soap/php_http.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ext/soap/php_http.c') diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index de599b229a..005d3af196 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -1419,7 +1419,12 @@ static zend_string* get_http_body(php_stream *stream, int close, char *headers) } return NULL; } - http_buf = zend_string_realloc(http_buf, http_buf_size + buf_size, 0); + + if (http_buf) { + http_buf = zend_string_realloc(http_buf, http_buf_size + buf_size, 0); + } else { + http_buf = zend_string_alloc(buf_size, 0); + } while (len_size < buf_size) { int len_read = php_stream_read(stream, http_buf->val + http_buf_size, buf_size - len_size); -- cgit v1.2.1