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>
This commit is contained in:
Denys Vlasenko
2016-06-20 11:06:42 +02:00
parent ecf25cb5bc
commit 984b0a613a
5 changed files with 23 additions and 28 deletions

View File

@@ -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)