From: Tobias Stoeckmann Date: Fri, 9 May 2025 11:30:32 +0000 (+0200) Subject: rar: Clean up br on split archive entries (#2593) X-Git-Tag: v3.8.0~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f4e0e4b70c8b7f0efb0503e4db1917035efd864;p=thirdparty%2Flibarchive.git rar: Clean up br on split archive entries (#2593) Reset avail_in and next_in if the next entry of a split archive is parsed to always update its internal structure to access next bytes when cache runs empty. Signed-off-by: Tobias Stoeckmann --- diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c index 6f9e431d0..d3b91b1fb 100644 --- a/libarchive/archive_read_support_format_rar.c +++ b/libarchive/archive_read_support_format_rar.c @@ -1673,6 +1673,8 @@ read_header(struct archive_read *a, struct archive_entry *entry, !memcmp(rar->filename, rar->filename_save, filename_size + 1)) { __archive_read_consume(a, header_size - 7); + rar->br.avail_in = 0; + rar->br.next_in = NULL; rar->cursor++; if (rar->cursor >= rar->nodes) { @@ -1783,6 +1785,7 @@ read_header(struct archive_read *a, struct archive_entry *entry, rar->offset_outgoing = 0; rar->br.cache_avail = 0; rar->br.avail_in = 0; + rar->br.next_in = NULL; rar->crc_calculated = 0; rar->entry_eof = 0; rar->valid = 1;