libarchive: treat one "FIXME: avoid seek", take 2
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 26 May 2019 11:43:06 +0000 (13:43 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 26 May 2019 11:43:06 +0000 (13:43 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
archival/libarchive/open_transformer.c

index 97bcc32f09e7ae3b71fe83e74ca16926a2ae8dbc..775bb580dad9d9b1fc989c9548e4954abd410d78 100644 (file)
@@ -352,13 +352,13 @@ void* FAST_FUNC xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_
                 *   read(4, "LF\2\1\1\0\0\0\0"...
                 * ...and we avoided seeking on the fd! :)
                 */
-               xstate->signature_skipped = 0;
                image = xmalloc_read_with_initial_buf(
                        xstate->src_fd,
                        maxsz_p,
                        xmemdup(&xstate->magic, xstate->signature_skipped),
                        xstate->signature_skipped
                );
+               xstate->signature_skipped = 0;
        }
 
        if (!image)