com php-src: Fix bug #73037, second round: ext/standard/php_f open_wrapper.c

From: Date: Wed, 05 Oct 2016 12:54:06 +0000
Subject: com php-src: Fix bug #73037, second round: ext/standard/php_f open_wrapper.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-94833@lists.php.net to get a copy of this message
Commit: 07546496b13e35105dae8e1c168d8356f2dd849d Author: Anatol Belski <ab@php.net> Wed, 5 Oct 2016 14:54:06 +0200 Parents: a10d03ac166daba646b6023e0f12e9ee8040c909 Branches: PHP-5.6 PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=07546496b13e35105dae8e1c168d8356f2dd849d Log: Fix bug #73037, second round Bugs: https://bugs.php.net/73037 Changed paths: M ext/standard/php_fopen_wrapper.c Diff: diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index ac434ce..af08c34 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -90,7 +90,11 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count } } - php_stream_seek(input->body, input->position, SEEK_SET); + if (!input->body->readfilters.head) { + /* If the input stream contains filters, it's not really seekable. The + input->position is likely to be wrong for unfiltered data. */ + php_stream_seek(input->body, input->position, SEEK_SET); + } read = php_stream_read(input->body, buf, count); if (!read || read == (size_t) -1) {

« previous php.cvs (#94833) next »