Fixed bug #70715 (Segmentation fault inside soap client)

This commit is contained in:
Xinchen Hui 2015-10-15 18:46:57 +08:00
parent a2005cec5c
commit 88a69ffa58
2 changed files with 6 additions and 1 deletions

1
NEWS
View File

@ -6,6 +6,7 @@ PHP NEWS
. Fixed bug #70689 (Exception handler does not work as expected). (Laruence)
- SOAP:
. Fixed bug #70715 (Segmentation fault inside soap client). (Laruence)
. Fixed bug #70709 (SOAP Client generates Segfault). (Laruence)
15 Oct 2015, PHP 7.0.0 RC 5

View File

@ -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;