summaryrefslogtreecommitdiff
path: root/archival/libunarchive/decompress_unxz.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/libunarchive/decompress_unxz.c')
-rw-r--r--archival/libunarchive/decompress_unxz.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/archival/libunarchive/decompress_unxz.c b/archival/libunarchive/decompress_unxz.c
index 5d7513a..721acd9 100644
--- a/archival/libunarchive/decompress_unxz.c
+++ b/archival/libunarchive/decompress_unxz.c
@@ -56,9 +56,11 @@ unpack_xz_stream(int src_fd, int dst_fd)
if (!crc32_table)
crc32_table = crc32_filltable(NULL, /*endian:*/ 0);
- membuf = xmalloc(2 * BUFSIZ);
memset(&iobuf, 0, sizeof(iobuf));
+ /* Preload XZ file signature */
+ membuf = (void*) strcpy(xmalloc(2 * BUFSIZ), HEADER_MAGIC);
iobuf.in = membuf;
+ iobuf.in_size = HEADER_MAGIC_SIZE;
iobuf.out = membuf + BUFSIZ;
iobuf.out_size = BUFSIZ;