From 0b3afcf67b35e3ec3929da266a28e5df9df962ff Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Tue, 20 Jan 2009 15:41:23 +0000 Subject: [PATCH] - MFH: Fixed bug #47152 (gzseek/fseek using SEEK_END produces strange results) --- ext/zlib/zlib_fopen_wrapper.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.50.1