]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
rar: Do not forcefully set offset to unpacked size
authorTobias Stoeckmann <tobias@stoeckmann.org>
Tue, 3 Jun 2025 19:59:05 +0000 (21:59 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Tue, 3 Jun 2025 19:59:05 +0000 (21:59 +0200)
If an entry reaches its end of file, the offset is not necessarily
the same as unp_size. This is especially true for links which have
a "0 size body" even though the unpacked size is not 0.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
libarchive/archive_read_support_format_rar.c

index 923ae5c65e1744214539fe812d96b47cee8ce7a2..04dff5b6c3a34379af8e0a494de161995f00b286 100644 (file)
@@ -1117,8 +1117,6 @@ archive_read_format_rar_read_data(struct archive_read *a, const void **buff,
   if (rar->entry_eof || rar->offset_seek >= rar->unp_size) {
     *size = 0;
     *offset = rar->offset;
-    if (*offset < rar->unp_size)
-      *offset = rar->unp_size;
     return (ARCHIVE_EOF);
   }