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

index dc4c5a70bfb2ef90114529af422869dee8078b9c..fb71cf11048a6d6dd0b278bbef940df2972b51ec 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;