summaryrefslogtreecommitdiffhomepage
path: root/archival/libarchive/decompress_gunzip.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-06-20 11:06:42 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-06-20 11:06:42 +0200
commit984b0a613aaf1cdf48c2e2af08c8466a7bad8307 (patch)
tree57b512d3843221b92da936b46abd238d1a036a94 /archival/libarchive/decompress_gunzip.c
parentecf25cb5bce27ca5820e2895d8458f38c406d105 (diff)
libarchive: fix xmalloc_open_zipped_read_close() on NOMMU
The somewhat new "unpack in memory" code was broken for xmalloc_open_zipped_read_close() on NOMMU: we seek back over signature, but then expect it to be already consumed. Stop seeking back in this case. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libarchive/decompress_gunzip.c')
-rw-r--r--archival/libarchive/decompress_gunzip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c
index 20e4d9ac5..c7fa5b526 100644
--- a/archival/libarchive/decompress_gunzip.c
+++ b/archival/libarchive/decompress_gunzip.c
@@ -1201,7 +1201,7 @@ unpack_gz_stream(transformer_state_t *xstate)
if (check_signature16(xstate, GZIP_MAGIC))
return -1;
#else
- if (xstate->check_signature) {
+ if (!xstate->signature_skipped) {
uint16_t magic2;
if (full_read(xstate->src_fd, &magic2, 2) != 2) {
@@ -1210,7 +1210,7 @@ unpack_gz_stream(transformer_state_t *xstate)
return -1;
}
if (magic2 == COMPRESS_MAGIC) {
- xstate->check_signature = 0;
+ xstate->signature_skipped = 2;
return unpack_Z_stream(xstate);
}
if (magic2 != GZIP_MAGIC)