summaryrefslogtreecommitdiff
path: root/ext/standard/http_fopen_wrapper.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2009-12-10 03:23:05 +0000
committerIlia Alshanetsky <iliaa@php.net>2009-12-10 03:23:05 +0000
commit47b3371122d03549af88a57d05442cf66c3eb83b (patch)
treeb5305940c0e6a0ad9f2602741507c24afa01910e /ext/standard/http_fopen_wrapper.c
parent7179910573b9445565c320cc3f44ab40c3235795 (diff)
downloadphp-git-47b3371122d03549af88a57d05442cf66c3eb83b.tar.gz
Fixed bug #49851 (http wrapper breaks on 1024 char long headers).
Diffstat (limited to 'ext/standard/http_fopen_wrapper.c')
-rw-r--r--ext/standard/http_fopen_wrapper.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 0e598909fa..9e144b7954 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -610,6 +610,10 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
size_t http_header_line_length;
if (php_stream_get_line(stream, http_header_line, HTTP_HEADER_BLOCK_SIZE, &http_header_line_length) && *http_header_line != '\n' && *http_header_line != '\r') {
char *e = http_header_line + http_header_line_length - 1;
+ if (*e != '\n') { /* partial header */
+ php_stream_get_line(stream, http_header_line, HTTP_HEADER_BLOCK_SIZE, &http_header_line_length);
+ continue;
+ }
while (*e == '\n' || *e == '\r') {
e--;
}