]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #49851 (http wrapper breaks on 1024 char long headers).
authorIlia Alshanetsky <iliaa@php.net>
Sun, 20 Dec 2009 19:14:30 +0000 (19:14 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 20 Dec 2009 19:14:30 +0000 (19:14 +0000)
NEWS
ext/standard/http_fopen_wrapper.c

diff --git a/NEWS b/NEWS
index 61ffd855d2d5bdad1bfb27352171c215ba0d0892..132cbbd01c1d4c0d4cee604c4fa2c20fddf36aa3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ PHP                                                                        NEWS
 - Fixed bug #50508 (compile failure: Conflicting HEADER type declarations).
   (Jani)
 - Fixed bug #50394 (Reference argument converted to value in __call). (Stas)
+- Fixed bug #49851 (http wrapper breaks on 1024 char long headers). (Ilia)
 
 
 17 Dec 2009, PHP 5.2.12
index 3777505d70bc7524a1814756d45bdf8c1e2394b1..242fab461d47d54e20761ae46fd738e0d79f7d5d 100644 (file)
@@ -605,6 +605,13 @@ 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') {
+                               do { /* partial header */
+                                       php_stream_get_line(stream, http_header_line, HTTP_HEADER_BLOCK_SIZE, &http_header_line_length);
+                                       e = http_header_line + http_header_line_length - 1;
+                               } while (*e != '\n');
+                               continue;
+                       }
                        while (*e == '\n' || *e == '\r') {
                                e--;
                        }