[Bug 1092759] New: gzseek calls can incorrectly position the file.

bugzilla at redhat.com bugzilla at redhat.com
Tue Apr 29 23:09:49 UTC 2014


https://bugzilla.redhat.com/show_bug.cgi?id=1092759

            Bug ID: 1092759
           Summary: gzseek calls can incorrectly position the file.
           Product: Fedora
           Version: 19
         Component: mingw-zlib
          Assignee: rjones at redhat.com
          Reporter: tsteven4 at gmail.com
        QA Contact: extras-qa at fedoraproject.org
                CC: erik-fedora at vanpienbroek.nl,
                    fedora-mingw at lists.fedoraproject.org,
                    lfarkas at lfarkas.org, rjones at redhat.com,
                    t.sailer at alumni.ethz.ch



Created attachment 890969
  --> https://bugzilla.redhat.com/attachment.cgi?id=890969&action=edit
zlib gzseek test case

Description of problem:  gzseek can incorrectly hit EOF, causing subsequent
gzread calls to fail.


Version-Release number of selected component (if applicable):
mingw32-zlib-1.2.7-2.fc19.noarch

How reproducible:
100%

Steps to Reproduce:
1. unzip test case zlib_test2.zip provided.
2. run test2 script to compile the test case.
3. execute test case by running testz2.exe under windows.  testz2.exe,
zlib1.dll and test.data all need to be in the directory testz2.exe is executed
from.

Actual results:
Got 0

Expected results:
Got 4

Additional info:
A possible patch with zlib 1.2.8 is listed below, although this might be a
configuration problem.  offset, which is of type z_off64_t, ends up being 32
bits as configured.
--- gzlib.c    2013-03-24 23:47:59.000000000 -0600
+++ gzlib.patch.c    2014-04-27 15:34:38.496808069 -0600
@@ -393,7 +393,7 @@
     /* if within raw area while reading, just go there */
     if (state->mode == GZ_READ && state->how == COPY &&
             state->x.pos + offset >= 0) {
-        ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
+        ret = LSEEK(state->fd, offset - (z_off64_t)state->x.have, SEEK_CUR);
         if (ret == -1)
             return -1;
         state->x.have = 0;

I have reported this to zlib at gzip.org but haven't received any response yet.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=t37ShhxD8T&a=cc_unsubscribe


More information about the mingw mailing list