From: Felipe Pena Date: Tue, 20 Jan 2009 15:41:04 +0000 (+0000) Subject: - Fixed bug #47152 (gzseek/fseek using SEEK_END produces strange results) X-Git-Tag: php-5.4.0alpha1~191^2~4449 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d150236d91b219716f53fe1a7679b4704181c0e;p=php - Fixed bug #47152 (gzseek/fseek using SEEK_END produces strange results) --- diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c index 24c1499b51..e2567d860a 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;