MFV r336800: libarchive: Cherry-pick upstream 2c8c83b9
Relevant vendor changes: Fix issue #948: out-of-bounds read in lha_read_data_none() admbugs: 877 MFC after: 3 days Security: CVE-2017-14503
This commit is contained in:
commit
2f4a276414
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336801
@ -701,6 +701,12 @@ archive_read_format_lha_read_header(struct archive_read *a,
|
|||||||
* Prepare variables used to read a file content.
|
* Prepare variables used to read a file content.
|
||||||
*/
|
*/
|
||||||
lha->entry_bytes_remaining = lha->compsize;
|
lha->entry_bytes_remaining = lha->compsize;
|
||||||
|
if (lha->entry_bytes_remaining < 0) {
|
||||||
|
archive_set_error(&a->archive,
|
||||||
|
ARCHIVE_ERRNO_FILE_FORMAT,
|
||||||
|
"Invalid LHa entry size");
|
||||||
|
return (ARCHIVE_FATAL);
|
||||||
|
}
|
||||||
lha->entry_offset = 0;
|
lha->entry_offset = 0;
|
||||||
lha->entry_crc_calculated = 0;
|
lha->entry_crc_calculated = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user