]> granicus.if.org Git - php/commitdiff
Fixed bug #70715 (Segmentation fault inside soap client)
authorXinchen Hui <laruence@gmail.com>
Thu, 15 Oct 2015 10:46:57 +0000 (18:46 +0800)
committerXinchen Hui <laruence@gmail.com>
Thu, 15 Oct 2015 10:46:57 +0000 (18:46 +0800)
NEWS
ext/soap/php_http.c

diff --git a/NEWS b/NEWS
index b1f6f043cacb6ecee9323259995c5c7611da34ea..55f82f022c97d5810befe2bf4e01e8d19d2a0e14 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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
index 005d3af196fc849ee8ab04cbcf75448786845498..b9e45f61b59559ce73b2614cd4acde591a47f9e1 100644 (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;