mirror of
https://github.com/php/php-src.git
synced 2024-09-29 05:46:06 +00:00
Fixed bug #49851 (http wrapper breaks on 1024 char long headers).
This commit is contained in:
parent
272974078b
commit
b9db7b4282
@ -653,6 +653,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, ZSTR(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--;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user