]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix check for EOF in RAR format reader.
authorAndres Mejia <amejia004@gmail.com>
Sat, 26 Jan 2013 17:00:38 +0000 (12:00 -0500)
committerAndres Mejia <amejia004@gmail.com>
Sat, 26 Jan 2013 17:00:38 +0000 (12:00 -0500)
libarchive/archive_read_support_format_rar.c

index 54f2f5f28a0c3ad96c5bdb976fc95cc0a76ea61b..4982c753f3cd4e83930436fd413f0e81130b9fe3 100644 (file)
@@ -944,10 +944,12 @@ archive_read_format_rar_read_data(struct archive_read *a, const void **buff,
       rar->bytes_unconsumed = 0;
   }
 
-  if (rar->entry_eof) {
+  if (rar->entry_eof || rar->offset_seek >= rar->unp_size) {
     *buff = NULL;
     *size = 0;
     *offset = rar->offset;
+    if (*offset < rar->unp_size)
+      *offset = rar->unp_size;
     return (ARCHIVE_EOF);
   }