diff options
| author | Antony Dovgal <tony2001@php.net> | 2011-11-08 13:30:58 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2011-11-08 13:30:58 +0000 |
| commit | 22b39bcc758395666e20c8b422849b40873acaa0 (patch) | |
| tree | 163bcd844ee41e8924c57185e19bb149671df73a | |
| parent | e86830273b4fb86a69cdb634a603be8a04e83846 (diff) | |
| download | php-git-22b39bcc758395666e20c8b422849b40873acaa0.tar.gz | |
bail out if reading HTTP headers failed
| -rw-r--r-- | ext/standard/http_fopen_wrapper.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 4567efc1f2..f477246e76 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -716,7 +716,10 @@ finish: char *e = http_header_line + http_header_line_length - 1; if (*e != '\n') { do { /* partial header */ - php_stream_get_line(stream, http_header_line, HTTP_HEADER_BLOCK_SIZE, &http_header_line_length); + if (php_stream_get_line(stream, http_header_line, HTTP_HEADER_BLOCK_SIZE, &http_header_line_length) == NULL) { + php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Failed to read HTTP headers"); + goto out; + } e = http_header_line + http_header_line_length - 1; } while (*e != '\n'); continue; |
