iliaa                                    Sun, 20 Dec 2009 19:14:30 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=292373

Log:
MFH: Fixed bug #49851 (http wrapper breaks on 1024 char long headers).

Bug: http://bugs.php.net/49851 (Assigned) http wrapper breaks on 1024 char long 
headers
      
Changed paths:
    U   php/php-src/branches/PHP_5_2/NEWS
    U   php/php-src/branches/PHP_5_2/ext/standard/http_fopen_wrapper.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===================================================================
--- php/php-src/branches/PHP_5_2/NEWS   2009-12-20 18:23:19 UTC (rev 292372)
+++ php/php-src/branches/PHP_5_2/NEWS   2009-12-20 19:14:30 UTC (rev 292373)
@@ -6,6 +6,7 @@
 - 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

Modified: php/php-src/branches/PHP_5_2/ext/standard/http_fopen_wrapper.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/http_fopen_wrapper.c      
2009-12-20 18:23:19 UTC (rev 292372)
+++ php/php-src/branches/PHP_5_2/ext/standard/http_fopen_wrapper.c      
2009-12-20 19:14:30 UTC (rev 292373)
@@ -605,6 +605,13 @@
                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--;
                        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to