]> granicus.if.org Git - php/commitdiff
fix potential integer overflow
authorStanislav Malyshev <stas@php.net>
Sat, 15 Oct 2011 23:57:33 +0000 (23:57 +0000)
committerStanislav Malyshev <stas@php.net>
Sat, 15 Oct 2011 23:57:33 +0000 (23:57 +0000)
ext/soap/php_http.c

index 1f2030189a13b2d9d5d11b38a4388bf0402f4c3c..7a4bc39da491a3e1c53931460501979e2d5decba 100644 (file)
@@ -1386,7 +1386,7 @@ static int get_http_body(php_stream *stream, int close, char *headers,  char **r
                if (header_length < 0) {
                        return FALSE;
                }
-               http_buf = emalloc(header_length + 1);
+               http_buf = safe_emalloc(1, header_length, 1);
                while (http_buf_size < header_length) {
                        int len_read = php_stream_read(stream, http_buf + http_buf_size, header_length - http_buf_size);
                        if (len_read <= 0) {