From: Michihiro NAKAJIMA Date: Tue, 20 Mar 2012 10:40:10 +0000 (+0900) Subject: An additional fix of issue 249. X-Git-Tag: v3.0.4~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=338fb93d5e42d6a16808a1ea7577d681d2feeb57;p=thirdparty%2Flibarchive.git An additional fix of issue 249. - Do not consume read bytes more than the entry used when reading an uncompressed CAB file. --- diff --git a/libarchive/archive_read_support_format_cab.c b/libarchive/archive_read_support_format_cab.c index bc866a375..81966c111 100644 --- a/libarchive/archive_read_support_format_cab.c +++ b/libarchive/archive_read_support_format_cab.c @@ -1932,6 +1932,11 @@ cab_read_data(struct archive_read *a, const void **buff, if (cab->entry_bytes_remaining == 0) cab->end_of_entry = 1; cab->entry_unconsumed = bytes_avail; + if (cab->entry_cffolder->comptype == COMPTYPE_NONE) { + /* Don't consume more than current entry used. */ + if (cab->entry_cfdata->unconsumed > cab->entry_unconsumed) + cab->entry_cfdata->unconsumed = cab->entry_unconsumed; + } return (ARCHIVE_OK); }