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_xar.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_xar.c')
-rw-r--r-- | libarchive/archive_read_support_format_xar.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libarchive/archive_read_support_format_xar.c b/libarchive/archive_read_support_format_xar.c index 503ff58b..ec5b06ed 100644 --- a/libarchive/archive_read_support_format_xar.c +++ b/libarchive/archive_read_support_format_xar.c @@ -624,7 +624,9 @@ read_toc(struct archive_read *a) __archive_read_consume(a, xar->toc_chksum_size); xar->offset += xar->toc_chksum_size; if (r != ARCHIVE_OK) +#ifndef DONT_FAIL_ON_CRC_ERROR return (ARCHIVE_FATAL); +#endif } /* @@ -827,10 +829,12 @@ xar_read_header(struct archive_read *a, struct archive_entry *entry) xattr->a_sum.val, xattr->a_sum.len, xattr->e_sum.val, xattr->e_sum.len); if (r != ARCHIVE_OK) { +#ifndef DONT_FAIL_ON_CRC_ERROR archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, "Xattr checksum error"); r = ARCHIVE_WARN; break; +#endif } if (xattr->name.s == NULL) { archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, |