diff options
author | Julien Voisin <jvoisin@google.com> | 2022-10-13 14:13:19 +0200 |
---|---|---|
committer | Julien Voisin <jvoisin@google.com> | 2022-10-16 18:43:29 +0200 |
commit | 98ce79a52ca67e0d0b6b2c867c1aa327c6c58240 (patch) | |
tree | fcc8259480c46794d80fec2aa956f158fdd24961 /libarchive/archive_read_support_format_lha.c | |
parent | 552547eacf6bfbdf5052f33cad57f181b6f92a61 (diff) | |
download | libarchive-98ce79a52ca67e0d0b6b2c867c1aa327c6c58240.tar.gz |
Extend the usage of the DONT_FAIL_ON_CRC_ERROR macro
DONT_FAIL_ON_CRC_ERROR is already used in the rar5 support code, so let's make
use of it in another places as well. This should tremendously help with
fuzzing.
Diffstat (limited to 'libarchive/archive_read_support_format_lha.c')
-rw-r--r-- | libarchive/archive_read_support_format_lha.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c index 6d0b6d2e..bcfd42e1 100644 --- a/libarchive/archive_read_support_format_lha.c +++ b/libarchive/archive_read_support_format_lha.c @@ -1039,9 +1039,11 @@ lha_read_file_header_2(struct archive_read *a, struct lha *lha) } if (header_crc != lha->header_crc) { +#ifndef DONT_FAIL_ON_CRC_ERROR archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "LHa header CRC error"); return (ARCHIVE_FATAL); +#endif } return (err); } @@ -1107,9 +1109,11 @@ lha_read_file_header_3(struct archive_read *a, struct lha *lha) return (err); if (header_crc != lha->header_crc) { +#ifndef DONT_FAIL_ON_CRC_ERROR archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "LHa header CRC error"); return (ARCHIVE_FATAL); +#endif } return (err); invalid: |