]> granicus.if.org Git - php/commitdiff
- Fixed bug #47152 (gzseek/fseek using SEEK_END produces strange results)
authorFelipe Pena <felipe@php.net>
Tue, 20 Jan 2009 15:41:04 +0000 (15:41 +0000)
committerFelipe Pena <felipe@php.net>
Tue, 20 Jan 2009 15:41:04 +0000 (15:41 +0000)
ext/zlib/zlib_fopen_wrapper.c

index 24c1499b51ca6cb230540ee622bdedf9cf55511a..e2567d860ad575d4f63070375c3ceb96abb535fd 100644 (file)
@@ -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;