Skip to content

Commit

Permalink
bail out if reading HTTP headers failed
Browse files Browse the repository at this point in the history
  • Loading branch information
tony2001 committed Nov 8, 2011
1 parent b44adcd commit 152aaba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ext/standard/http_fopen_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,10 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
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;
Expand Down

0 comments on commit 152aaba

Please sign in to comment.