]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
7zip: Support streamable reading again 3074/head
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 25 May 2026 21:45:34 +0000 (23:45 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 25 May 2026 21:45:34 +0000 (23:45 +0200)
The slurp_central_directory function has been changed to always use
seek, which is not needed and also breaks streamable 7-Zip archives.

Resolves an issue observed in #3068.

Fixes: 71ef1c385249 ("7zip: Merge skip_sfx into get_data_offset")
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
libarchive/archive_read_support_format_7zip.c

index 3084e77e6ff007d1c9911e0830988bd015582dc0..ebd65095814c7bdb3413f77a16903c45c5dfac83 100644 (file)
@@ -3260,7 +3260,7 @@ slurp_central_directory(struct archive_read *a, struct _7zip *zip,
 
        if (get_data_offset(a, &data_offset) < 0)
                return (ARCHIVE_FATAL);
-       if (__archive_read_seek(a, data_offset, SEEK_SET) < 0)
+       if (__archive_read_consume(a, data_offset) < 0)
                return (ARCHIVE_FATAL);
        if ((p = __archive_read_ahead(a, 32, &bytes_avail)) == NULL)
                return (ARCHIVE_FATAL);