From: Michihiro NAKAJIMA Date: Wed, 2 Jul 2014 12:12:42 +0000 (+0900) Subject: Properly set buffer,offset and size when lha format reader returns X-Git-Tag: v3.1.900a~268 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cada9e9225fabc26a918573ae30e511a5d0d2fcb;p=thirdparty%2Flibarchive.git Properly set buffer,offset and size when lha format reader returns ARCHIVE_WAR by getting CRC error.o --- diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c index b88731afa..3c565c001 100644 --- a/libarchive/archive_read_support_format_lha.c +++ b/libarchive/archive_read_support_format_lha.c @@ -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)