]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Ignore checksum mismatches when fuzzing tar archives (#2378)
authorTim Kientzle <kientzle@acm.org>
Sun, 13 Oct 2024 07:42:38 +0000 (00:42 -0700)
committerGitHub <noreply@github.com>
Sun, 13 Oct 2024 07:42:38 +0000 (09:42 +0200)
This should speed up fuzzing just a bit, so we
can find more bugs!

libarchive/archive_read_support_format_tar.c

index a0ff8b1dbb256c3739705b7db576b0da1308c818..ecaf6c392d9a2ecd81e2858d159233003eb3b329 100644 (file)
@@ -1005,7 +1005,12 @@ checksum(struct archive_read *a, const void *h)
        if (sum == check)
                return (1);
 
+#if DONT_FAIL_ON_CRC_ERROR
+       /* Speed up fuzzing by pretending the checksum is always right. */
+       return (1);
+#else
        return (0);
+#endif
 }
 
 /*