]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Properly set buffer,offset and size when lha format reader returns
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 2 Jul 2014 12:12:42 +0000 (21:12 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 2 Jul 2014 12:12:42 +0000 (21:12 +0900)
ARCHIVE_WAR by getting CRC error.o

libarchive/archive_read_support_format_lha.c

index b88731afa8c608378a6b85ea59b48b06e7c820b0..3c565c0015bdb8f41d35b578dc878970929d1f9d 100644 (file)
@@ -1390,13 +1390,14 @@ archive_read_format_lha_read_data(struct archive_read *a,
                lha->entry_unconsumed = 0;
        }
        if (lha->end_of_entry) {
+               r = ARCHIVE_EOF;
                if (!lha->end_of_entry_cleanup) {
                        if ((lha->setflag & CRC_IS_SET) &&
                            lha->crc != lha->entry_crc_calculated) {
                                archive_set_error(&a->archive,
                                    ARCHIVE_ERRNO_MISC,
                                    "LHa data CRC error");
-                               return (ARCHIVE_WARN);
+                               r = ARCHIVE_WARN;
                        }
 
                        /* End-of-entry cleanup done. */
@@ -1405,7 +1406,7 @@ archive_read_format_lha_read_data(struct archive_read *a,
                *offset = lha->entry_offset;
                *size = 0;
                *buff = NULL;
-               return (ARCHIVE_EOF);
+               return (r);
        }
 
        if (lha->entry_is_compressed)