summaryrefslogtreecommitdiff
path: root/libarchive/archive_read_support_format_xar.c
diff options
context:
space:
mode:
authorJulien Voisin <jvoisin@google.com>2022-10-13 14:13:19 +0200
committerJulien Voisin <jvoisin@google.com>2022-10-16 18:43:29 +0200
commit98ce79a52ca67e0d0b6b2c867c1aa327c6c58240 (patch)
treefcc8259480c46794d80fec2aa956f158fdd24961 /libarchive/archive_read_support_format_xar.c
parent552547eacf6bfbdf5052f33cad57f181b6f92a61 (diff)
downloadlibarchive-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.c4
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,