From: Felipe Pena Date: Tue, 20 Jan 2009 15:43:06 +0000 (+0000) Subject: - MFH: Fixed bug #47152 (gzseek/fseek using SEEK_END produces strange results) X-Git-Tag: php-5.2.9RC1~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91ec3a8141ad6996c95691ffe340de1cd525552a;p=php - MFH: Fixed bug #47152 (gzseek/fseek using SEEK_END produces strange results) --- diff --git a/NEWS b/NEWS index fde8dd18c1..9113cc6ba6 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ PHP NEWS - Fixed bug in xml_error_string() which resulted in messages being off by one. (Scott) +- Fixed bug #47152 (gzseek/fseek using SEEK_END produces strange results). + (Felipe) - Fixed bug #47131 (SOAP Extension ignores "user_agent" ini setting). (Ilia) - Fixed bug #47104 (Linking shared extensions fails with icc). (Jani) - Fixed bug #47109 (Memory leak on $a->{"a"."b"} when $a is not an object). diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c index dc4c5a70bf..fb71cf1104 100644 --- a/ext/zlib/zlib_fopen_wrapper.c +++ b/ext/zlib/zlib_fopen_wrapper.c @@ -60,6 +60,10 @@ static int php_gziop_seek(php_stream *stream, off_t offset, int whence, off_t *n assert(self != NULL); + if (whence == SEEK_END) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "SEEK_END is not supported"); + return -1; + } *newoffs = gzseek(self->gz_file, offset, whence); return (*newoffs < 0) ? -1 : 0;