From 167ebccee47e842b35251bbd792b0c47303fa4a7 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 4 Mar 2024 14:15:00 -0800 Subject: [PATCH 01/66] Test with multiple runs that use different length limits --- .github/workflows/ci.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 86aed674..da1253ed 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -99,6 +99,8 @@ jobs: timeout-minutes: 330 run: | cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=2048 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=50000000 -max_len=4096 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=20000000 -max_len=5000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -125,7 +127,8 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=16384 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=4096 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=20000000 -max_len=32768 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -152,7 +155,8 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=5000000 -max_len=2000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=5000000 -max_len=1000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=1000000 -max_len=2000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -180,6 +184,7 @@ jobs: timeout-minutes: 330 run: | cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=10000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=5000000 -max_len=20000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 340bf58eeb138555a73927f65af09551565a1bfc Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 4 Mar 2024 14:18:08 -0800 Subject: [PATCH 02/66] Start fuzz_read with just a 1k limit --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index da1253ed..220485a2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=2048 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=1024 -dict=fuzz/fuzz.dict cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=50000000 -max_len=4096 -dict=fuzz/fuzz.dict cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=20000000 -max_len=5000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs @@ -127,7 +127,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=4096 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=1024 -dict=fuzz/fuzz.dict cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=20000000 -max_len=32768 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() From 9efd5cbd22328b712c94cc888f52456b22a03d55 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 4 Mar 2024 14:39:31 -0800 Subject: [PATCH 03/66] Add a 2KiB step between 1K and 4K --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 220485a2..08b8ee6a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -99,6 +99,7 @@ jobs: timeout-minutes: 330 run: | cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=1024 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=50000000 -max_len=2048 -dict=fuzz/fuzz.dict cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=50000000 -max_len=4096 -dict=fuzz/fuzz.dict cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=20000000 -max_len=5000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs From ad9884169e11c8fc7a67da518600d8d555b4198b Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 4 Mar 2024 14:56:02 -0800 Subject: [PATCH 04/66] Revert "Add a 2KiB step between 1K and 4K" This reverts commit 9efd5cbd22328b712c94cc888f52456b22a03d55. --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 08b8ee6a..220485a2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -99,7 +99,6 @@ jobs: timeout-minutes: 330 run: | cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=1024 -dict=fuzz/fuzz.dict - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=50000000 -max_len=2048 -dict=fuzz/fuzz.dict cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=50000000 -max_len=4096 -dict=fuzz/fuzz.dict cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=20000000 -max_len=5000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs From bacdc687d419e9893a4e1396d20c35fd825e0bfc Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 4 Mar 2024 14:56:04 -0800 Subject: [PATCH 05/66] Revert "Start fuzz_read with just a 1k limit" This reverts commit 340bf58eeb138555a73927f65af09551565a1bfc. --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 220485a2..da1253ed 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=1024 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=2048 -dict=fuzz/fuzz.dict cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=50000000 -max_len=4096 -dict=fuzz/fuzz.dict cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=20000000 -max_len=5000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs @@ -127,7 +127,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=1024 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=4096 -dict=fuzz/fuzz.dict cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=20000000 -max_len=32768 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() From eee10a7ed0cb0da9d9f57031f2166dd62a3f06c7 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 4 Mar 2024 14:56:05 -0800 Subject: [PATCH 06/66] Revert "Test with multiple runs that use different length limits" This reverts commit 167ebccee47e842b35251bbd792b0c47303fa4a7. --- .github/workflows/ci.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index da1253ed..86aed674 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -99,8 +99,6 @@ jobs: timeout-minutes: 330 run: | cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=2048 -dict=fuzz/fuzz.dict - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=50000000 -max_len=4096 -dict=fuzz/fuzz.dict - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=20000000 -max_len=5000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -127,8 +125,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=4096 -dict=fuzz/fuzz.dict - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=20000000 -max_len=32768 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=16384 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -155,8 +152,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=5000000 -max_len=1000 -dict=fuzz/fuzz.dict - cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=1000000 -max_len=2000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=5000000 -max_len=2000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -184,7 +180,6 @@ jobs: timeout-minutes: 330 run: | cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=10000 -dict=fuzz/fuzz.dict - cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=5000000 -max_len=20000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 6c8e3fcedbcef0ec5c1d07762ce2185974abeffe Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 4 Mar 2024 14:57:56 -0800 Subject: [PATCH 07/66] Test using len_control option to limit early lengths --- .github/workflows/ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 86aed674..cea3e61e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=2048 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=6000 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -125,7 +125,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=16384 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -152,7 +152,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=5000000 -max_len=2000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -179,7 +179,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=10000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 1bbe2b83ae77330be0cec0911b5bcb68aea815d0 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 4 Mar 2024 15:07:53 -0800 Subject: [PATCH 08/66] Bug fix: artifact names and paths were wrong for no_features fuzzes --- .github/workflows/ci.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cea3e61e..2cc4f250 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=6000 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -130,8 +130,8 @@ jobs: if: always() uses: actions/upload-artifact@v3 with: - name: fuzz_read_bad_inputs - path: fuzz/artifacts/fuzz_read_no_features/crash-* + name: fuzz_read_no_features_bad_inputs + path: fuzz/artifacts/fuzz_read/crash-* if-no-files-found: ignore fuzz_write: @@ -184,6 +184,6 @@ jobs: if: always() uses: actions/upload-artifact@v3 with: - name: fuzz_write_bad_inputs - path: fuzz/artifacts/fuzz_write_no_features/crash-* + name: fuzz_write_no_features_bad_inputs + path: fuzz/artifacts/fuzz_write/crash-* if-no-files-found: ignore \ No newline at end of file From 7c1c367493c2b52f2251fc3a624029ffbf0648af Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 4 Mar 2024 15:13:42 -0800 Subject: [PATCH 09/66] Test with extreme len_control of 1000 --- .github/workflows/ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2cc4f250..ddfb90a2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=1000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -125,7 +125,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=1000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -152,7 +152,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=1000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -179,7 +179,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=1000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 650d4942717d93fbf38faecdd33d0ea3415a6ed4 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 4 Mar 2024 15:21:29 -0800 Subject: [PATCH 10/66] Test with len_control of 10k (suitable if max_len <= len_control * iteration) --- .github/workflows/ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ddfb90a2..bf6d12cf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=1000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -125,7 +125,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=1000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -152,7 +152,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=1000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -179,7 +179,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=1000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 64494b7927105d48b6845bb337ce3793f9048eb5 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 4 Mar 2024 16:52:43 -0800 Subject: [PATCH 11/66] Lower len_control for fuzz_write --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bf6d12cf..0c3a14df 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -152,7 +152,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -179,7 +179,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From ce11179be30efdb7e89f1921f300b9c1f9b4d895 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 4 Mar 2024 17:35:12 -0800 Subject: [PATCH 12/66] Add test case for https://github.com/anatawa12/deflate64-rs/issues/25 --- src/read.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/read.rs b/src/read.rs index 2dec6eca..89a8458e 100644 --- a/src/read.rs +++ b/src/read.rs @@ -1373,4 +1373,13 @@ mod test { std::io::copy(&mut reader.by_index(0)?, &mut std::io::sink()).expect_err("Invalid file"); Ok(()) } + + #[cfg(feature = "deflate64")] + #[test] + fn deflate64_not_enough_space() -> std::io::Result<()> { + let v = vec![80, 7, 2, 134, 75, 1, 2, 0, 0, 1, 0, 64, 0, 80, 75, 3, 10, 41, 80, 7, 2, 80, 75, 1, 2, 0, 1, 80, 19, 80, 12, 9, 0, 0, 79, 80, 75, 5, 6, 61, 61, 61, 61, 1, 0, 9, 0, 14, 0, 0, 0, 3, 0, 0, 0, 1, 0, 64, 0, 80, 75, 3, 4, 41, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 58, 17, 1, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 93, 0, 255, 255, 255, 155, 155, 255, 255, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 59, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 239, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 140, 255, 239, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 46, 46, 46, 46, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 93, 0, 255, 246, 255, 155, 155, 148, 14, 0, 155, 0, 148, 14, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 29, 29, 29, 29, 29, 29, 29, 255, 255, 3, 0, 0, 155, 29, 29, 58, 29, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 155, 155, 155, 0, 64, 0, 80, 75, 3, 4, 41, 0, 0, 0, 0, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 59, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 212, 38, 198, 62, 175, 46, 0, 0, 46, 46, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 140, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 46, 46, 46, 46, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 4, 0, 80, 75, 0, 0, 5, 0]; + let mut reader = ZipArchive::new(Cursor::new(v))?; + std::io::copy(&mut reader.by_index(0)?, &mut std::io::sink()).expect_err("Invalid file"); + Ok(()) + } } From be49def529af1f9a4a2114a4bbafcacc3ec6c157 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Wed, 6 Mar 2024 12:34:51 -0800 Subject: [PATCH 13/66] Replace hard-coded byte array with data file --- src/read.rs | 5 ++++- tests/data/deflate64_issue_25.zip | Bin 0 -> 970 bytes 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 tests/data/deflate64_issue_25.zip diff --git a/src/read.rs b/src/read.rs index 89a8458e..b1834698 100644 --- a/src/read.rs +++ b/src/read.rs @@ -1377,7 +1377,10 @@ mod test { #[cfg(feature = "deflate64")] #[test] fn deflate64_not_enough_space() -> std::io::Result<()> { - let v = vec![80, 7, 2, 134, 75, 1, 2, 0, 0, 1, 0, 64, 0, 80, 75, 3, 10, 41, 80, 7, 2, 80, 75, 1, 2, 0, 1, 80, 19, 80, 12, 9, 0, 0, 79, 80, 75, 5, 6, 61, 61, 61, 61, 1, 0, 9, 0, 14, 0, 0, 0, 3, 0, 0, 0, 1, 0, 64, 0, 80, 75, 3, 4, 41, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 58, 17, 1, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 93, 0, 255, 255, 255, 155, 155, 255, 255, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 59, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 239, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 140, 255, 239, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 46, 46, 46, 46, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 93, 0, 255, 246, 255, 155, 155, 148, 14, 0, 155, 0, 148, 14, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 29, 29, 29, 29, 29, 29, 29, 255, 255, 3, 0, 0, 155, 29, 29, 58, 29, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 155, 155, 155, 0, 64, 0, 80, 75, 3, 4, 41, 0, 0, 0, 0, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 59, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 212, 38, 198, 62, 175, 46, 0, 0, 46, 46, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 140, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 46, 46, 46, 46, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 4, 0, 80, 75, 0, 0, 5, 0]; + let mut v = Vec::new(); + v.extend_from_slice(include_bytes!( + "../tests/data/deflate64_issue_25.zip" + )); let mut reader = ZipArchive::new(Cursor::new(v))?; std::io::copy(&mut reader.by_index(0)?, &mut std::io::sink()).expect_err("Invalid file"); Ok(()) diff --git a/tests/data/deflate64_issue_25.zip b/tests/data/deflate64_issue_25.zip new file mode 100644 index 0000000000000000000000000000000000000000..add89a109f02ed03b740ddf7571b5fdbcb978f34 GIT binary patch literal 970 zcmWIWW@Zs#U|`^6VDJy{W@WPl0!AQ@4=BdKU?s@-9~+2e0E*6@{r^8$6-Wh`flTO8 z4y?&D0-J+T#NMOuDC6|}M>7rVX5@f?u_?2MkZ!Oo$clhb^bHtAQ}`HWGXM!>DO_w> z2>Ab>nSo)ptgMwRE``L3&z?P-!GR$Fn8Y+e?!y_KBt`TUwPSYc^+2W(>kO)>>p?e# r8WGI`3>*dqRv^j9q{oaqAHveml12~ Date: Thu, 7 Mar 2024 14:34:40 -0800 Subject: [PATCH 14/66] Overhaul read logic to perform *all* validations before accepting a central directory as the real one --- src/read.rs | 273 ++++++++++++++++++++++++++++----------------------- src/write.rs | 54 +++++----- 2 files changed, 172 insertions(+), 155 deletions(-) diff --git a/src/read.rs b/src/read.rs index b1834698..4f35a7ac 100644 --- a/src/read.rs +++ b/src/read.rs @@ -14,6 +14,7 @@ use std::borrow::Cow; use std::collections::HashMap; use std::io::{self, prelude::*}; use std::path::Path; +use std::rc::Rc; use std::sync::Arc; #[cfg(any( @@ -38,13 +39,17 @@ pub(crate) mod stream; // Put the struct declaration in a private module to convince rustdoc to display ZipArchive nicely pub(crate) mod zip_archive { + use std::rc::Rc; + /// Extract immutable data from `ZipArchive` to make it cheap to clone #[derive(Debug)] pub(crate) struct Shared { - pub(super) files: Vec, - pub(super) names_map: super::HashMap, + pub(crate) files: Vec, + pub(crate) names_map: super::HashMap, pub(super) offset: u64, - pub(super) comment: Vec, + pub(super) comment: Rc>, + pub(super) dir_start: u64, + pub(super) dir_end: u64, } /// ZIP archive reader @@ -74,6 +79,7 @@ pub(crate) mod zip_archive { } } +use crate::read::zip_archive::Shared; pub use zip_archive::ZipArchive; #[allow(clippy::large_enum_variant)] @@ -311,7 +317,7 @@ pub(crate) fn make_reader( } } -pub(crate) struct DirectoryCounts { +pub(crate) struct CentralDirectoryInfo { pub(crate) archive_offset: u64, pub(crate) directory_start: u64, pub(crate) number_of_files: usize, @@ -320,10 +326,10 @@ pub(crate) struct DirectoryCounts { } impl ZipArchive { - fn get_directory_counts_zip32( + fn get_directory_info_zip32( footer: &spec::CentralDirectoryEnd, cde_start_pos: u64, - ) -> ZipResult { + ) -> ZipResult { // Some zip files have data prepended to them, resulting in the // offsets all being too small. Get the amount of error by comparing // the actual file position we found the CDE at with the offset @@ -337,7 +343,7 @@ impl ZipArchive { let directory_start = footer.central_directory_offset as u64 + archive_offset; let number_of_files = footer.number_of_files_on_this_disk as usize; - Ok(DirectoryCounts { + Ok(CentralDirectoryInfo { archive_offset, directory_start, number_of_files, @@ -346,11 +352,11 @@ impl ZipArchive { }) } - fn get_directory_counts_zip64( + fn get_directory_info_zip64( reader: &mut R, footer: &spec::CentralDirectoryEnd, cde_start_pos: u64, - ) -> ZipResult { + ) -> ZipResult>> { // See if there's a ZIP64 footer. The ZIP64 locator if present will // have its signature 20 bytes in front of the standard footer. The // standard footer, in turn, is 22+N bytes large, where N is the @@ -366,99 +372,158 @@ impl ZipArchive { // actual offset in the file, since there may be junk at its // beginning. Therefore we need to perform another search, as in // read::CentralDirectoryEnd::find_and_parse, except now we search - // forward. + // forward. There may be multiple results because of Zip64 central-directory signatures in + // ZIP comment data. + + let mut results = Vec::new(); let search_upper_bound = cde_start_pos .checked_sub(60) // minimum size of Zip64CentralDirectoryEnd + Zip64CentralDirectoryEndLocator .ok_or(ZipError::InvalidArchive( "File cannot contain ZIP64 central directory end", ))?; - let (footer64, archive_offset) = spec::Zip64CentralDirectoryEnd::find_and_parse( + while let Ok((footer64, archive_offset)) = spec::Zip64CentralDirectoryEnd::find_and_parse( reader, locator64.end_of_central_directory_offset, search_upper_bound, - )?; - - let directory_start = footer64 - .central_directory_offset - .checked_add(archive_offset) - .ok_or(ZipError::InvalidArchive( - "Invalid central directory size or offset", - ))?; - if directory_start > search_upper_bound { - return Err(ZipError::InvalidArchive( - "Invalid central directory size or offset", - )); + ) { + results.push({ + let directory_start = footer64 + .central_directory_offset + .checked_add(archive_offset) + .ok_or(ZipError::InvalidArchive( + "Invalid central directory size or offset", + ))?; + if directory_start > search_upper_bound { + return Err(ZipError::InvalidArchive( + "Invalid central directory size or offset", + )); + } + if footer64.number_of_files_on_this_disk > footer64.number_of_files { + return Err(ZipError::InvalidArchive( + "ZIP64 footer indicates more files on this disk than in the whole archive", + )); + } + if footer64.version_needed_to_extract > footer64.version_made_by { + return Err(ZipError::InvalidArchive( + "ZIP64 footer indicates a new version is needed to extract this archive than the \ + version that wrote it", + )); + } + Ok(CentralDirectoryInfo { + archive_offset, + directory_start, + number_of_files: footer64.number_of_files as usize, + disk_number: footer64.disk_number, + disk_with_central_directory: footer64.disk_with_central_directory, + }) + }); } - if footer64.number_of_files_on_this_disk > footer64.number_of_files { - return Err(ZipError::InvalidArchive( - "ZIP64 footer indicates more files on this disk than in the whole archive", - )); - } - if footer64.version_needed_to_extract > footer64.version_made_by { - return Err(ZipError::InvalidArchive( - "ZIP64 footer indicates a new version is needed to extract this archive than the \ - version that wrote it", - )); - } - - Ok(DirectoryCounts { - archive_offset, - directory_start, - number_of_files: footer64.number_of_files as usize, - disk_number: footer64.disk_number, - disk_with_central_directory: footer64.disk_with_central_directory, - }) + Ok(results) } /// Get the directory start offset and number of files. This is done in a /// separate function to ease the control flow design. - pub(crate) fn get_directory_counts( + pub(crate) fn get_metadata( reader: &mut R, - footer: &spec::CentralDirectoryEnd, + footer: spec::CentralDirectoryEnd, cde_start_pos: u64, - ) -> ZipResult { + ) -> ZipResult { // Check if file has a zip64 footer - let counts_64 = Self::get_directory_counts_zip64(reader, footer, cde_start_pos); - let counts_32 = Self::get_directory_counts_zip32(footer, cde_start_pos); - match counts_64 { - Err(_) => match counts_32 { - Err(e) => Err(e), - Ok(counts) => { - if counts.disk_number != counts.disk_with_central_directory { + let mut results = Self::get_directory_info_zip64(reader, &footer, cde_start_pos) + .unwrap_or_else(|e| vec![Err(e)]); + let zip32_result = Self::get_directory_info_zip32(&footer, cde_start_pos); + let mut invalid_errors = Vec::new(); + let mut unsupported_errors = Vec::new(); + let mut ok_results = Vec::new(); + let comment = Rc::new(footer.zip_file_comment); + results.iter_mut().for_each(|result| { + if let Ok(central_dir) = result { + if let Ok(zip32_central_dir) = &zip32_result { + // Both zip32 and zip64 footers exist, so check if the zip64 footer is valid; if not, try zip32 + if central_dir.number_of_files != zip32_central_dir.number_of_files + && zip32_central_dir.number_of_files != u16::MAX as usize + { + *result = Err(ZipError::InvalidArchive( + "ZIP32 and ZIP64 file counts don't match", + )); + return; + } + if central_dir.disk_number != zip32_central_dir.disk_number + && zip32_central_dir.disk_number != u16::MAX as u32 + { + *result = Err(ZipError::InvalidArchive( + "ZIP32 and ZIP64 disk numbers don't match", + )); + return; + } + if central_dir.disk_with_central_directory + != zip32_central_dir.disk_with_central_directory + && zip32_central_dir.disk_with_central_directory != u16::MAX as u32 + { + *result = Err(ZipError::InvalidArchive( + "ZIP32 and ZIP64 last-disk numbers don't match", + )); + return; + } + } + } + }); + results.push(zip32_result); + results + .into_iter() + .map(|result| { + result.and_then(|dir_info| { + // If the parsed number of files is greater than the offset then + // something fishy is going on and we shouldn't trust number_of_files. + let file_capacity = if dir_info.number_of_files > cde_start_pos as usize { + 0 + } else { + dir_info.number_of_files + }; + let mut files = Vec::with_capacity(file_capacity); + let mut names_map = HashMap::with_capacity(file_capacity); + + for _ in 0..dir_info.number_of_files { + let file = central_header_to_zip_file(reader, dir_info.archive_offset)?; + names_map.insert(file.file_name.clone(), files.len()); + files.push(file); + } + let dir_end = reader.seek(io::SeekFrom::Start(dir_info.directory_start))?; + if dir_info.disk_number != dir_info.disk_with_central_directory { return unsupported_zip_error( "Support for multi-disk files is not implemented", ); } - Ok(counts) + Ok(Shared { + files, + names_map, + offset: dir_info.archive_offset, + comment: comment.clone(), + dir_start: dir_info.directory_start, + dir_end, + }) + }) + }) + .for_each(|result| match result { + Err(ZipError::UnsupportedArchive(e)) => { + unsupported_errors.push(ZipError::UnsupportedArchive(e)) } - }, - Ok(counts_64) => { - match counts_32 { - Err(_) => Ok(counts_64), - Ok(counts_32) => { - // Both zip32 and zip64 footers exist, so check if the zip64 footer is valid; if not, try zip32 - if counts_64.number_of_files != counts_32.number_of_files - && counts_32.number_of_files != u16::MAX as usize - { - return Ok(counts_32); - } - if counts_64.disk_number != counts_32.disk_number - && counts_32.disk_number != u16::MAX as u32 - { - return Ok(counts_32); - } - if counts_64.disk_with_central_directory - != counts_32.disk_with_central_directory - && counts_32.disk_with_central_directory != u16::MAX as u32 - { - return Ok(counts_32); - } - Ok(counts_64) - } - } - } + Err(e) => invalid_errors.push(e), + Ok(o) => ok_results.push(o), + }); + if ok_results.is_empty() { + return Err(unsupported_errors + .into_iter() + .next() + .unwrap_or_else(|| invalid_errors.into_iter().next().unwrap())); } + let shared = ok_results + .into_iter() + .max_by_key(|shared| shared.dir_end) + .unwrap(); + reader.seek(io::SeekFrom::Start(shared.dir_start))?; + Ok(shared) } /// Read a ZIP archive, collecting the files it contains @@ -466,47 +531,11 @@ impl ZipArchive { /// This uses the central directory record of the ZIP file, and ignores local file headers pub fn new(mut reader: R) -> ZipResult> { let (footer, cde_start_pos) = spec::CentralDirectoryEnd::find_and_parse(&mut reader)?; - - let counts = Self::get_directory_counts(&mut reader, &footer, cde_start_pos)?; - - if counts.disk_number != counts.disk_with_central_directory { - return unsupported_zip_error("Support for multi-disk files is not implemented"); - } - - // If the parsed number of files is greater than the offset then - // something fishy is going on and we shouldn't trust number_of_files. - let file_capacity = if counts.number_of_files > cde_start_pos as usize { - 0 - } else { - counts.number_of_files - }; - - let mut files = Vec::with_capacity(file_capacity); - let mut names_map = HashMap::with_capacity(file_capacity); - - if reader - .seek(io::SeekFrom::Start(counts.directory_start)) - .is_err() - { - return Err(ZipError::InvalidArchive( - "Could not seek to start of central directory", - )); - } - - for _ in 0..counts.number_of_files { - let file = central_header_to_zip_file(&mut reader, counts.archive_offset)?; - names_map.insert(file.file_name.clone(), files.len()); - files.push(file); - } - - let shared = Arc::new(zip_archive::Shared { - files, - names_map, - offset: counts.archive_offset, - comment: footer.zip_file_comment, - }); - - Ok(ZipArchive { reader, shared }) + let shared = Self::get_metadata(&mut reader, footer, cde_start_pos)?; + Ok(ZipArchive { + reader, + shared: Arc::new(shared), + }) } /// Extract a Zip archive into a directory, overwriting files if they /// already exist. Paths are sanitized with [`ZipFile::enclosed_name`]. @@ -1378,9 +1407,7 @@ mod test { #[test] fn deflate64_not_enough_space() -> std::io::Result<()> { let mut v = Vec::new(); - v.extend_from_slice(include_bytes!( - "../tests/data/deflate64_issue_25.zip" - )); + v.extend_from_slice(include_bytes!("../tests/data/deflate64_issue_25.zip")); let mut reader = ZipArchive::new(Cursor::new(v))?; std::io::copy(&mut reader.by_index(0)?, &mut std::io::sink()).expect_err("Invalid file"); Ok(()) diff --git a/src/write.rs b/src/write.rs index 2abf7861..8960b819 100644 --- a/src/write.rs +++ b/src/write.rs @@ -1,7 +1,7 @@ //! Types for creating ZIP archives use crate::compression::CompressionMethod; -use crate::read::{central_header_to_zip_file, find_content, ZipArchive, ZipFile, ZipFileReader}; +use crate::read::{find_content, ZipArchive, ZipFile, ZipFileReader}; use crate::result::{ZipError, ZipResult}; use crate::spec; use crate::types::{ffi, AtomicU64, DateTime, System, ZipFileData, DEFAULT_VERSION}; @@ -435,42 +435,16 @@ impl ZipWriter { /// Initializes the archive from an existing ZIP archive, making it ready for append. pub fn new_append(mut readwriter: A) -> ZipResult> { let (footer, cde_start_pos) = spec::CentralDirectoryEnd::find_and_parse(&mut readwriter)?; - - let counts = ZipArchive::get_directory_counts(&mut readwriter, &footer, cde_start_pos)?; - - if counts.disk_number != counts.disk_with_central_directory { - return Err(ZipError::UnsupportedArchive( - "Support for multi-disk files is not implemented", - )); - } - - if readwriter - .seek(SeekFrom::Start(counts.directory_start)) - .is_err() - { - return Err(InvalidArchive( - "Could not seek to start of central directory", - )); - } - - let files = (0..counts.number_of_files) - .map(|_| central_header_to_zip_file(&mut readwriter, counts.archive_offset)) - .collect::, _>>()?; - - let mut files_by_name = HashMap::new(); - for (index, file) in files.iter().enumerate() { - files_by_name.insert(file.file_name.to_owned(), index); - } - - let _ = readwriter.seek(SeekFrom::Start(counts.directory_start)); // seek directory_start to overwrite it + let comment = footer.zip_file_comment.to_owned(); + let metadata = ZipArchive::get_metadata(&mut readwriter, footer, cde_start_pos)?; Ok(ZipWriter { inner: Storer(MaybeEncrypted::Unencrypted(readwriter)), - files, - files_by_name, + files: metadata.files, + files_by_name: metadata.names_map, stats: Default::default(), writing_to_file: false, - comment: footer.zip_file_comment, + comment, writing_raw: true, // avoid recomputing the last file's header flush_on_finish_file: false, }) @@ -2077,4 +2051,20 @@ mod test { writer.write_all(&[]).unwrap(); Ok(()) } + + #[test] + fn crash_with_no_features() -> ZipResult<()> { + const ORIGINAL_FILE_NAME: &str = "PK\u{6}\u{6}\0\0\0\0\0\0\0\0\0\u{2}g\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\u{1}\0\0\0\0\0\0\0\0\0\0PK\u{6}\u{7}\0\0\0\0\0\0\0\0\0\0\0\0\u{7}\0\t'"; + let mut writer = ZipWriter::new(io::Cursor::new(Vec::new())); + let mut options = FileOptions::default(); + options = options + .with_alignment(3584) + .compression_method(CompressionMethod::Stored); + writer.start_file(ORIGINAL_FILE_NAME, options)?; + let archive = writer.finish()?; + let mut writer = ZipWriter::new_append(archive)?; + writer.shallow_copy_file(ORIGINAL_FILE_NAME, "\u{6}\\")?; + writer.finish()?; + Ok(()) + } } From e23ba853d36db1a2d4af8d9bea0f91e04e625438 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 14:43:40 -0800 Subject: [PATCH 15/66] Remove comment field from `Shared` to avoid unnecessary copying --- src/read.rs | 21 +++++++++------------ src/write.rs | 5 ++--- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/read.rs b/src/read.rs index 4f35a7ac..3ee9cf0f 100644 --- a/src/read.rs +++ b/src/read.rs @@ -14,7 +14,6 @@ use std::borrow::Cow; use std::collections::HashMap; use std::io::{self, prelude::*}; use std::path::Path; -use std::rc::Rc; use std::sync::Arc; #[cfg(any( @@ -39,7 +38,7 @@ pub(crate) mod stream; // Put the struct declaration in a private module to convince rustdoc to display ZipArchive nicely pub(crate) mod zip_archive { - use std::rc::Rc; + use std::sync::Arc; /// Extract immutable data from `ZipArchive` to make it cheap to clone #[derive(Debug)] @@ -47,7 +46,6 @@ pub(crate) mod zip_archive { pub(crate) files: Vec, pub(crate) names_map: super::HashMap, pub(super) offset: u64, - pub(super) comment: Rc>, pub(super) dir_start: u64, pub(super) dir_end: u64, } @@ -75,7 +73,8 @@ pub(crate) mod zip_archive { #[derive(Clone, Debug)] pub struct ZipArchive { pub(super) reader: R, - pub(super) shared: super::Arc, + pub(super) shared: Arc, + pub(super) comment: Vec, } } @@ -426,17 +425,16 @@ impl ZipArchive { /// separate function to ease the control flow design. pub(crate) fn get_metadata( reader: &mut R, - footer: spec::CentralDirectoryEnd, + footer: &spec::CentralDirectoryEnd, cde_start_pos: u64, ) -> ZipResult { // Check if file has a zip64 footer - let mut results = Self::get_directory_info_zip64(reader, &footer, cde_start_pos) + let mut results = Self::get_directory_info_zip64(reader, footer, cde_start_pos) .unwrap_or_else(|e| vec![Err(e)]); - let zip32_result = Self::get_directory_info_zip32(&footer, cde_start_pos); + let zip32_result = Self::get_directory_info_zip32(footer, cde_start_pos); let mut invalid_errors = Vec::new(); let mut unsupported_errors = Vec::new(); let mut ok_results = Vec::new(); - let comment = Rc::new(footer.zip_file_comment); results.iter_mut().for_each(|result| { if let Ok(central_dir) = result { if let Ok(zip32_central_dir) = &zip32_result { @@ -464,7 +462,6 @@ impl ZipArchive { *result = Err(ZipError::InvalidArchive( "ZIP32 and ZIP64 last-disk numbers don't match", )); - return; } } } @@ -499,7 +496,6 @@ impl ZipArchive { files, names_map, offset: dir_info.archive_offset, - comment: comment.clone(), dir_start: dir_info.directory_start, dir_end, }) @@ -531,10 +527,11 @@ impl ZipArchive { /// This uses the central directory record of the ZIP file, and ignores local file headers pub fn new(mut reader: R) -> ZipResult> { let (footer, cde_start_pos) = spec::CentralDirectoryEnd::find_and_parse(&mut reader)?; - let shared = Self::get_metadata(&mut reader, footer, cde_start_pos)?; + let shared = Self::get_metadata(&mut reader, &footer, cde_start_pos)?; Ok(ZipArchive { reader, shared: Arc::new(shared), + comment: footer.zip_file_comment, }) } /// Extract a Zip archive into a directory, overwriting files if they @@ -596,7 +593,7 @@ impl ZipArchive { /// Get the comment of the zip archive. pub fn comment(&self) -> &[u8] { - &self.shared.comment + &self.comment } /// Returns an iterator over all the file and directory names in this archive. diff --git a/src/write.rs b/src/write.rs index 8960b819..1cdf1c3d 100644 --- a/src/write.rs +++ b/src/write.rs @@ -435,8 +435,7 @@ impl ZipWriter { /// Initializes the archive from an existing ZIP archive, making it ready for append. pub fn new_append(mut readwriter: A) -> ZipResult> { let (footer, cde_start_pos) = spec::CentralDirectoryEnd::find_and_parse(&mut readwriter)?; - let comment = footer.zip_file_comment.to_owned(); - let metadata = ZipArchive::get_metadata(&mut readwriter, footer, cde_start_pos)?; + let metadata = ZipArchive::get_metadata(&mut readwriter, &footer, cde_start_pos)?; Ok(ZipWriter { inner: Storer(MaybeEncrypted::Unencrypted(readwriter)), @@ -444,7 +443,7 @@ impl ZipWriter { files_by_name: metadata.names_map, stats: Default::default(), writing_to_file: false, - comment, + comment: footer.zip_file_comment, writing_raw: true, // avoid recomputing the last file's header flush_on_finish_file: false, }) From 5e03f43f9a01696191336c1ea73575a36627bfa3 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 15:16:04 -0800 Subject: [PATCH 16/66] Fix failing tests other than deflate64 bug 25 --- src/read.rs | 82 ++++++++++++++++++++++++++--------------------------- src/spec.rs | 16 +++++++---- 2 files changed, 51 insertions(+), 47 deletions(-) diff --git a/src/read.rs b/src/read.rs index 3ee9cf0f..e05172bf 100644 --- a/src/read.rs +++ b/src/read.rs @@ -5,6 +5,7 @@ use crate::aes::{AesReader, AesReaderValid}; use crate::compression::CompressionMethod; use crate::cp437::FromCp437; use crate::crc32::Crc32Reader; +use crate::read::zip_archive::Shared; use crate::result::{InvalidPassword, ZipError, ZipResult}; use crate::spec; use crate::types::{AesMode, AesVendorVersion, AtomicU64, DateTime, System, ZipFileData}; @@ -74,11 +75,10 @@ pub(crate) mod zip_archive { pub struct ZipArchive { pub(super) reader: R, pub(super) shared: Arc, - pub(super) comment: Vec, + pub(super) comment: Arc>, } } -use crate::read::zip_archive::Shared; pub use zip_archive::ZipArchive; #[allow(clippy::large_enum_variant)] @@ -381,43 +381,45 @@ impl ZipArchive { .ok_or(ZipError::InvalidArchive( "File cannot contain ZIP64 central directory end", ))?; - while let Ok((footer64, archive_offset)) = spec::Zip64CentralDirectoryEnd::find_and_parse( + let search_results = spec::Zip64CentralDirectoryEnd::find_and_parse( reader, locator64.end_of_central_directory_offset, search_upper_bound, - ) { + )?; + search_results.into_iter().for_each(|(footer64, archive_offset)| { results.push({ - let directory_start = footer64 + let directory_start_result = footer64 .central_directory_offset .checked_add(archive_offset) .ok_or(ZipError::InvalidArchive( "Invalid central directory size or offset", - ))?; - if directory_start > search_upper_bound { - return Err(ZipError::InvalidArchive( - "Invalid central directory size or offset", )); - } - if footer64.number_of_files_on_this_disk > footer64.number_of_files { - return Err(ZipError::InvalidArchive( - "ZIP64 footer indicates more files on this disk than in the whole archive", - )); - } - if footer64.version_needed_to_extract > footer64.version_made_by { - return Err(ZipError::InvalidArchive( - "ZIP64 footer indicates a new version is needed to extract this archive than the \ + directory_start_result.and_then(|directory_start| { + if directory_start > search_upper_bound { + Err(ZipError::InvalidArchive( + "Invalid central directory size or offset", + )) + } else if footer64.number_of_files_on_this_disk > footer64.number_of_files { + Err(ZipError::InvalidArchive( + "ZIP64 footer indicates more files on this disk than in the whole archive", + )) + } else if footer64.version_needed_to_extract > footer64.version_made_by { + Err(ZipError::InvalidArchive( + "ZIP64 footer indicates a new version is needed to extract this archive than the \ version that wrote it", - )); - } - Ok(CentralDirectoryInfo { - archive_offset, - directory_start, - number_of_files: footer64.number_of_files as usize, - disk_number: footer64.disk_number, - disk_with_central_directory: footer64.disk_with_central_directory, + )) + } else { + Ok(CentralDirectoryInfo { + archive_offset, + directory_start, + number_of_files: footer64.number_of_files as usize, + disk_number: footer64.disk_number, + disk_with_central_directory: footer64.disk_with_central_directory, + }) + } }) }); - } + }); Ok(results) } @@ -480,25 +482,23 @@ impl ZipArchive { }; let mut files = Vec::with_capacity(file_capacity); let mut names_map = HashMap::with_capacity(file_capacity); - + let dir_end = reader.seek(io::SeekFrom::Start(dir_info.directory_start))?; for _ in 0..dir_info.number_of_files { let file = central_header_to_zip_file(reader, dir_info.archive_offset)?; names_map.insert(file.file_name.clone(), files.len()); files.push(file); } - let dir_end = reader.seek(io::SeekFrom::Start(dir_info.directory_start))?; if dir_info.disk_number != dir_info.disk_with_central_directory { - return unsupported_zip_error( - "Support for multi-disk files is not implemented", - ); + unsupported_zip_error("Support for multi-disk files is not implemented") + } else { + Ok(Shared { + files, + names_map, + offset: dir_info.archive_offset, + dir_start: dir_info.directory_start, + dir_end, + }) } - Ok(Shared { - files, - names_map, - offset: dir_info.archive_offset, - dir_start: dir_info.directory_start, - dir_end, - }) }) }) .for_each(|result| match result { @@ -530,8 +530,8 @@ impl ZipArchive { let shared = Self::get_metadata(&mut reader, &footer, cde_start_pos)?; Ok(ZipArchive { reader, - shared: Arc::new(shared), - comment: footer.zip_file_comment, + shared: shared.into(), + comment: footer.zip_file_comment.into(), }) } /// Extract a Zip archive into a directory, overwriting files if they diff --git a/src/spec.rs b/src/spec.rs index 691f2cab..d7cdd7c6 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -145,7 +145,8 @@ impl Zip64CentralDirectoryEnd { reader: &mut T, nominal_offset: u64, search_upper_bound: u64, - ) -> ZipResult<(Zip64CentralDirectoryEnd, u64)> { + ) -> ZipResult> { + let mut results = Vec::new(); let mut pos = search_upper_bound; while pos >= nominal_offset { @@ -166,7 +167,7 @@ impl Zip64CentralDirectoryEnd { let central_directory_size = reader.read_u64::()?; let central_directory_offset = reader.read_u64::()?; - return Ok(( + results.push(( Zip64CentralDirectoryEnd { version_made_by, version_needed_to_extract, @@ -186,10 +187,13 @@ impl Zip64CentralDirectoryEnd { break; } } - - Err(ZipError::InvalidArchive( - "Could not find ZIP64 central directory end", - )) + if results.is_empty() { + Err(ZipError::InvalidArchive( + "Could not find ZIP64 central directory end", + )) + } else { + Ok(results) + } } pub fn write(&self, writer: &mut T) -> ZipResult<()> { From 63382421548ad720b5a9b123012ccabc766d8b04 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 15:23:56 -0800 Subject: [PATCH 17/66] Bug fix: `dir_end` was being set incorrectly --- src/read.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/read.rs b/src/read.rs index e05172bf..a9aedadd 100644 --- a/src/read.rs +++ b/src/read.rs @@ -482,12 +482,13 @@ impl ZipArchive { }; let mut files = Vec::with_capacity(file_capacity); let mut names_map = HashMap::with_capacity(file_capacity); - let dir_end = reader.seek(io::SeekFrom::Start(dir_info.directory_start))?; + reader.seek(io::SeekFrom::Start(dir_info.directory_start))?; for _ in 0..dir_info.number_of_files { let file = central_header_to_zip_file(reader, dir_info.archive_offset)?; names_map.insert(file.file_name.clone(), files.len()); files.push(file); } + let dir_end = reader.seek(io::SeekFrom::Start(dir_info.directory_start))?; if dir_info.disk_number != dir_info.disk_with_central_directory { unsupported_zip_error("Support for multi-disk files is not implemented") } else { From ef9438122ad2907c15d88d0e6b46600c7833bf1e Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 16:21:59 -0800 Subject: [PATCH 18/66] Test fuzzing with debug symbols --- .github/workflows/ci.yaml | 12 ++++++++---- Cargo.toml | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0c3a14df..1b75b49b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -82,7 +82,8 @@ jobs: fuzz_read: runs-on: ubuntu-latest - + env: + RUSTFLAGS: --profile=release-with-debug steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -109,7 +110,8 @@ jobs: fuzz_read_with_no_features: runs-on: ubuntu-latest - + env: + RUSTFLAGS: --profile=release-with-debug steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -136,7 +138,8 @@ jobs: fuzz_write: runs-on: ubuntu-latest - + env: + RUSTFLAGS: --profile=release-with-debug steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -163,7 +166,8 @@ jobs: fuzz_write_with_no_features: runs-on: ubuntu-latest - + env: + RUSTFLAGS: --profile=release-with-debug steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 diff --git a/Cargo.toml b/Cargo.toml index 7107b7b2..3bb0ea7c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,10 @@ zstd = { version = "0.13.0", optional = true, default-features = false } zopfli = { version = "0.8.0", optional = true } deflate64 = { git = "https://github.com/Pr0methean/deflate64-rs.git", optional = true } +[profile.release-with-debug] +inherits = "release" +debug = true + [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies] crossbeam-utils = "0.8.19" From fd6630afd2318f1e5b920e03888b7b086ff1f4bf Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 16:24:34 -0800 Subject: [PATCH 19/66] Bug fix: RUSTFLAGS doesn't work to set profile, so set it in each `cargo` call --- .github/workflows/ci.yaml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1b75b49b..1c6ca020 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -95,11 +95,11 @@ jobs: - run: cargo install cargo-fuzz - name: compile fuzz run: | - cargo fuzz build fuzz_read + cargo fuzz build --profile=release-with-debug fuzz_read - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run --profile=release-with-debug fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -123,11 +123,11 @@ jobs: - run: cargo install cargo-fuzz - name: compile fuzz run: | - cargo fuzz build --no-default-features fuzz_read + cargo fuzz build --profile=release-with-debug --no-default-features fuzz_read - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run --profile=release-with-debug --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -138,8 +138,6 @@ jobs: fuzz_write: runs-on: ubuntu-latest - env: - RUSTFLAGS: --profile=release-with-debug steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -151,11 +149,11 @@ jobs: - run: cargo install cargo-fuzz - name: compile fuzz run: | - cargo fuzz build fuzz_write + cargo fuzz build --profile=release-with-debug fuzz_write - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run --profile=release-with-debug fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -166,8 +164,6 @@ jobs: fuzz_write_with_no_features: runs-on: ubuntu-latest - env: - RUSTFLAGS: --profile=release-with-debug steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -179,11 +175,11 @@ jobs: - run: cargo install cargo-fuzz - name: compile fuzz run: | - cargo fuzz build --no-default-features fuzz_write + cargo fuzz build --profile=release-with-debug --no-default-features fuzz_write - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run --profile=release-with-debug --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 9a1fd624816995be6db00ec65f66926b9c805c16 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 16:31:08 -0800 Subject: [PATCH 20/66] Revert "Bug fix: RUSTFLAGS doesn't work to set profile, so set it in each `cargo` call" This reverts commit fd6630afd2318f1e5b920e03888b7b086ff1f4bf. --- .github/workflows/ci.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1c6ca020..1b75b49b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -95,11 +95,11 @@ jobs: - run: cargo install cargo-fuzz - name: compile fuzz run: | - cargo fuzz build --profile=release-with-debug fuzz_read + cargo fuzz build fuzz_read - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --profile=release-with-debug fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -123,11 +123,11 @@ jobs: - run: cargo install cargo-fuzz - name: compile fuzz run: | - cargo fuzz build --profile=release-with-debug --no-default-features fuzz_read + cargo fuzz build --no-default-features fuzz_read - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --profile=release-with-debug --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -138,6 +138,8 @@ jobs: fuzz_write: runs-on: ubuntu-latest + env: + RUSTFLAGS: --profile=release-with-debug steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -149,11 +151,11 @@ jobs: - run: cargo install cargo-fuzz - name: compile fuzz run: | - cargo fuzz build --profile=release-with-debug fuzz_write + cargo fuzz build fuzz_write - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --profile=release-with-debug fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -164,6 +166,8 @@ jobs: fuzz_write_with_no_features: runs-on: ubuntu-latest + env: + RUSTFLAGS: --profile=release-with-debug steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -175,11 +179,11 @@ jobs: - run: cargo install cargo-fuzz - name: compile fuzz run: | - cargo fuzz build --profile=release-with-debug --no-default-features fuzz_write + cargo fuzz build --no-default-features fuzz_write - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --profile=release-with-debug --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From a4fe6900439f10f39f3baa7e93bb55a45f7ab95c Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 16:31:09 -0800 Subject: [PATCH 21/66] Revert "Test fuzzing with debug symbols" This reverts commit ef9438122ad2907c15d88d0e6b46600c7833bf1e. --- .github/workflows/ci.yaml | 12 ++++-------- Cargo.toml | 4 ---- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1b75b49b..0c3a14df 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -82,8 +82,7 @@ jobs: fuzz_read: runs-on: ubuntu-latest - env: - RUSTFLAGS: --profile=release-with-debug + steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -110,8 +109,7 @@ jobs: fuzz_read_with_no_features: runs-on: ubuntu-latest - env: - RUSTFLAGS: --profile=release-with-debug + steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -138,8 +136,7 @@ jobs: fuzz_write: runs-on: ubuntu-latest - env: - RUSTFLAGS: --profile=release-with-debug + steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -166,8 +163,7 @@ jobs: fuzz_write_with_no_features: runs-on: ubuntu-latest - env: - RUSTFLAGS: --profile=release-with-debug + steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 diff --git a/Cargo.toml b/Cargo.toml index 3bb0ea7c..7107b7b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,10 +28,6 @@ zstd = { version = "0.13.0", optional = true, default-features = false } zopfli = { version = "0.8.0", optional = true } deflate64 = { git = "https://github.com/Pr0methean/deflate64-rs.git", optional = true } -[profile.release-with-debug] -inherits = "release" -debug = true - [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies] crossbeam-utils = "0.8.19" From 5148ad025851f087119bc831e8faac2cfa1d3622 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 16:39:29 -0800 Subject: [PATCH 22/66] Revert "Test with len_control of 10k (suitable if max_len <= len_control * iteration)" This reverts commit 650d4942 --- .github/workflows/ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0c3a14df..ddfb90a2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=1000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -125,7 +125,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=1000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -152,7 +152,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=1000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -179,7 +179,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=1000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From e803ac62db3fb5ea10c63353c5c8c056d145b407 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 17:07:25 -0800 Subject: [PATCH 23/66] Revert "Revert "Test with len_control of 10k (suitable if max_len <= len_control * iteration)"" This reverts commit 5148ad025851f087119bc831e8faac2cfa1d3622. --- .github/workflows/ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ddfb90a2..0c3a14df 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=1000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -125,7 +125,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=1000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -152,7 +152,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=1000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -179,7 +179,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=1000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_write -- -timeout=10s -fork=2 -runs=20000000 -max_len=10000 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 8243dc52adfde2a37e1622ab0f0e76100c35917d Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 17:08:12 -0800 Subject: [PATCH 24/66] Test with `--len-control=5000` --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0c3a14df..2a24544f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=5000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -125,7 +125,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=5000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From f19b8f222985b34fb2ed198d5d40e06aee24c35a Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 17:16:39 -0800 Subject: [PATCH 25/66] Revert "Test with `--len-control=5000`" This reverts commit 8243dc52adfde2a37e1622ab0f0e76100c35917d. --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2a24544f..0c3a14df 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=5000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -125,7 +125,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=5000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 643ab65d76947108d2696fe858f4a7e011da1ae3 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 17:26:29 -0800 Subject: [PATCH 26/66] Test with `--max_len=4600` --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0c3a14df..c66c7c4c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=4600 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 0ccff2a2e7f828fdaf17c8c86e93393b225629bb Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 17:29:00 -0800 Subject: [PATCH 27/66] Test with `--max_len=4700` --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c66c7c4c..d3fbcbe8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=4600 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=4700 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 716d7480f5ba1ff92c267d57384f3e998fafaa08 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 17:34:00 -0800 Subject: [PATCH 28/66] Test with `--max_len=2100` --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d3fbcbe8..c579a849 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=4700 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=2100 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -152,7 +152,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=1100 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From f051f0229068c4205b0bfc09ac4b334787b8ea37 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 17:41:23 -0800 Subject: [PATCH 29/66] Test with `--max_len=1100` --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c579a849..ce30b037 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=2100 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=1100 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 880fda6f2b45511abe0c774352d697cb58c5dd45 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 18:03:42 -0800 Subject: [PATCH 30/66] Revert "Test with `--max_len=1100`" This reverts commit f051f0229068c4205b0bfc09ac4b334787b8ea37. --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ce30b037..c579a849 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=1100 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=2100 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 86b95972727e34b58be4019bd65b372368681933 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 18:03:43 -0800 Subject: [PATCH 31/66] Revert "Test with `--max_len=2100`" This reverts commit 716d7480f5ba1ff92c267d57384f3e998fafaa08. --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c579a849..d3fbcbe8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=2100 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=4700 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -152,7 +152,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=1100 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 7d4d584cff3854516d151d01d783a5254a206230 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 18:03:45 -0800 Subject: [PATCH 32/66] Revert "Test with `--max_len=4700`" This reverts commit 0ccff2a2e7f828fdaf17c8c86e93393b225629bb. --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d3fbcbe8..c66c7c4c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=4700 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=4600 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From fc30aa2b53f75b99053fa63648069e6925350bb6 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 18:03:47 -0800 Subject: [PATCH 33/66] Revert "Test with `--max_len=4600`" This reverts commit 643ab65d76947108d2696fe858f4a7e011da1ae3. --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c66c7c4c..0c3a14df 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=4600 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From febe2c1b2b4d82475d8954b89b15e76f916f0c49 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 18:04:33 -0800 Subject: [PATCH 34/66] Retain smaller length for fuzz_write --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0c3a14df..7f153be3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -152,7 +152,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=2000 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_write -- -timeout=10s -fork=2 -runs=10000000 -max_len=1100 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 963570f8c2e3646cdb1b9d13f64ec64f1ba73eb1 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 18:20:22 -0800 Subject: [PATCH 35/66] Test with `-max-len=1100` but with a billion iterations --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7f153be3..ff2dc176 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=1100 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -125,7 +125,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From f7023a3d9de10dd4b7d780589133afe56d7989ad Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 18:52:23 -0800 Subject: [PATCH 36/66] Test with old max_len and 500m iterations --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ff2dc176..147a3192 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=1100 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=500000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 4367dac3956f26abb7a2957d4152d9160d49eb51 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 18:53:04 -0800 Subject: [PATCH 37/66] Test with 16KiB max_len and 200m iterations --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 147a3192..5ce56c8e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=500000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From c34501d1b62e8d2ba9e792e5952b01b24ad81bae Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 19:08:03 -0800 Subject: [PATCH 38/66] Revert "Test with 16KiB max_len and 200m iterations" This reverts commit 4367dac3956f26abb7a2957d4152d9160d49eb51. --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5ce56c8e..147a3192 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=500000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From c7690dac42d354f08b8fc19b0438b9bab63403bb Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 19:08:04 -0800 Subject: [PATCH 39/66] Revert "Test with old max_len and 500m iterations" This reverts commit f7023a3d9de10dd4b7d780589133afe56d7989ad. --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 147a3192..ff2dc176 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=500000000 -max_len=5000 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=1100 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 50fba29ee6c504bbf576364519900888dc816665 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 19:43:13 -0800 Subject: [PATCH 40/66] Test with max_len=2100 and 500m iterations --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ff2dc176..62b111b2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=1100 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=500000000 -max_len=2100 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From e08c8a1fe9c1b21f73b80f0e985f9744b0243059 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 20:01:35 -0800 Subject: [PATCH 41/66] Test with even harder fuzz_read settings (16KiB input, 1e9 iterations) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 62b111b2..e808f36b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=500000000 -max_len=2100 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From d38ac84db56adbd2734b8ce0d138a23e4e161e55 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Sat, 9 Mar 2024 13:34:26 -0800 Subject: [PATCH 42/66] Test adding an unsupported compression method to the dictionary --- fuzz/fuzz.dict | 1 + 1 file changed, 1 insertion(+) diff --git a/fuzz/fuzz.dict b/fuzz/fuzz.dict index b33a23f6..c586acc4 100644 --- a/fuzz/fuzz.dict +++ b/fuzz/fuzz.dict @@ -16,4 +16,5 @@ compression_method_deflate64="\x09\x00" compression_method_bzip2="\x0E\x00" compression_method_zstd="]\x00" compression_method_aes="C\x00" +compression_method_unsupported="\xFF\x00" "\xFF\xFF" \ No newline at end of file From b85dd4ba827a41248b6865f590802f624765136a Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Sat, 9 Mar 2024 14:46:29 -0800 Subject: [PATCH 43/66] Replace reproducing zip with a smaller one --- tests/data/deflate64_issue_25.zip | Bin 970 -> 94 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/data/deflate64_issue_25.zip b/tests/data/deflate64_issue_25.zip index add89a109f02ed03b740ddf7571b5fdbcb978f34..78139edd50043418e6ab1237844625924c4dd9ce 100644 GIT binary patch literal 94 zcmWIWW@Zs#VBp|nSi3PZf}!x=e;{~o^Z);TIR*v>E(V5dh5%+Di$OEMo0Sd3U}Si| me=ma-koC5qGZIMEFL@{x0g`;mz+lhF0MyS0#6Tndy8{4S4j@$k literal 970 zcmWIWW@Zs#U|`^6VDJy{W@WPl0!AQ@4=BdKU?s@-9~+2e0E*6@{r^8$6-Wh`flTO8 z4y?&D0-J+T#NMOuDC6|}M>7rVX5@f?u_?2MkZ!Oo$clhb^bHtAQ}`HWGXM!>DO_w> z2>Ab>nSo)ptgMwRE``L3&z?P-!GR$Fn8Y+e?!y_KBt`TUwPSYc^+2W(>kO)>>p?e# r8WGI`3>*dqRv^j9q{oaqAHveml12~ Date: Mon, 11 Mar 2024 13:26:46 -0700 Subject: [PATCH 44/66] Switch to upstream deflate64 trunk --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7107b7b2..be97ae60 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ sha1 = {version = "0.10.6", optional = true } time = { version = "0.3.34", optional = true, default-features = false, features = ["std"] } zstd = { version = "0.13.0", optional = true, default-features = false } zopfli = { version = "0.8.0", optional = true } -deflate64 = { git = "https://github.com/Pr0methean/deflate64-rs.git", optional = true } +deflate64 = { git = "https://github.com/anatawa12/deflate64-rs.git", optional = true } [target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies] crossbeam-utils = "0.8.19" From 6d8de51bea354f83a0d031d5c658760d1283d676 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 11 Mar 2024 13:32:58 -0700 Subject: [PATCH 45/66] Bug fix: expected error result now happens sooner --- src/read.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/read.rs b/src/read.rs index a9aedadd..bed33efc 100644 --- a/src/read.rs +++ b/src/read.rs @@ -1403,11 +1403,9 @@ mod test { #[cfg(feature = "deflate64")] #[test] - fn deflate64_not_enough_space() -> std::io::Result<()> { + fn deflate64_not_enough_space() { let mut v = Vec::new(); v.extend_from_slice(include_bytes!("../tests/data/deflate64_issue_25.zip")); - let mut reader = ZipArchive::new(Cursor::new(v))?; - std::io::copy(&mut reader.by_index(0)?, &mut std::io::sink()).expect_err("Invalid file"); - Ok(()) + ZipArchive::new(Cursor::new(v)).expect_err("Invalid file"); } } From 739f5761a1ccf5e164c4f93d45029af0a7fb72e4 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 11 Mar 2024 14:22:52 -0700 Subject: [PATCH 46/66] Revert "Test with even harder fuzz_read settings (16KiB input, 1e9 iterations)" This reverts commit e08c8a1fe9c1b21f73b80f0e985f9744b0243059. --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e808f36b..62b111b2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=500000000 -max_len=2100 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From cb70cd4031644cf2faa896233e4b5a10bc9b74b4 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 11 Mar 2024 14:48:20 -0700 Subject: [PATCH 47/66] Test with max_len=1050 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 62b111b2..9578c052 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=500000000 -max_len=2100 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=1050 -len_control=1000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 9a6005bdd04927a110da7e4ae8ea2efc9cd78dd4 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 11 Mar 2024 15:10:53 -0700 Subject: [PATCH 48/66] Test with max_len=600 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9578c052..2c6048c7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=1050 -len_control=1000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=500000000 -max_len=600 -len_control=1000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 6e976d394a7552258beab5ee5f21a01d753c2396 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 11 Mar 2024 15:32:24 -0700 Subject: [PATCH 49/66] Revert "Test with max_len=600" This reverts commit 9a6005bdd04927a110da7e4ae8ea2efc9cd78dd4. --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2c6048c7..9578c052 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=500000000 -max_len=600 -len_control=1000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=1050 -len_control=1000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From b2927819ee88f209a5eb3d3cb884493c6ec3bda2 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 11 Mar 2024 15:48:00 -0700 Subject: [PATCH 50/66] Test with max_len=600 and len_control=200 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9578c052..af66455d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=1050 -len_control=1000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=600 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From a6869fbc9bba2deb695f3baf3173abc2b8edaf28 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 11 Mar 2024 16:10:45 -0700 Subject: [PATCH 51/66] Test with len_control=500 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index af66455d..756324d2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=600 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=600 -len_control=500 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 845f848cc4b2e50acfa3f3dcd4c69f4c6432fa16 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 11 Mar 2024 16:31:41 -0700 Subject: [PATCH 52/66] Test with max_len=1050 and len_control=500 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 756324d2..d85d77a7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=600 -len_control=500 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=1050 -len_control=500 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 8b52cc24c5970f07a34bc3d4bc34faf77079a98a Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 11 Mar 2024 16:34:59 -0700 Subject: [PATCH 53/66] Test with max_len=1200 and len_control=500 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d85d77a7..f135df96 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=1050 -len_control=500 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=1200 -len_control=500 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From ddc92a49c30443615fc87eec67b25cc227f07a2b Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Tue, 12 Mar 2024 17:23:46 -0700 Subject: [PATCH 54/66] Test new settings: max_len=600, len_control=500, runs=100M --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f135df96..da1ec3e6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=1200 -len_control=500 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=600 -len_control=500 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 5049249fd9a381a4c2f4f23fd6313dc2857cbfcf Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Tue, 12 Mar 2024 17:58:03 -0700 Subject: [PATCH 55/66] Test with len_control=200 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index da1ec3e6..36c73803 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=600 -len_control=500 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=600 -len_control=200 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 9bce0dcb0ffea54024b71c0aad12e2737f7fccd5 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Tue, 12 Mar 2024 18:11:56 -0700 Subject: [PATCH 56/66] Test with len_control=1000 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 36c73803..b08eef5a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=600 -len_control=200 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=600 -len_control=1000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 60f8f9b910908a3b2e268a720c2b479974609ab0 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Tue, 12 Mar 2024 18:47:10 -0700 Subject: [PATCH 57/66] Test with len_control=500 runs=200M --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b08eef5a..4b433815 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=100000000 -max_len=600 -len_control=1000 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=600 -len_control=500 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 5bdf9b7c30ceb35e0894c5af42a65b031ccfc337 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Tue, 12 Mar 2024 19:22:52 -0700 Subject: [PATCH 58/66] Test with a "seed corpus" consisting of an empty zip file --- .github/workflows/ci.yaml | 4 ++-- fuzz/corpus/seed/empty.zip | Bin 0 -> 95 bytes 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 fuzz/corpus/seed/empty.zip diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4b433815..0738c0e9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- -timeout=10s -fork=2 -runs=200000000 -max_len=600 -len_control=500 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- fuzz/corpus/seed -timeout=10s -fork=2 -runs=200000000 -max_len=600 -len_control=500 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -125,7 +125,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- -timeout=10s -fork=2 -runs=1000000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- fuzz/corpus/seed -timeout=10s -fork=2 -runs=1000000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 diff --git a/fuzz/corpus/seed/empty.zip b/fuzz/corpus/seed/empty.zip new file mode 100644 index 0000000000000000000000000000000000000000..a3cdf74bb8d93d720e7e343592ff0a15efc56c41 GIT binary patch literal 95 QcmZQzpf2!cWkWU)00me8R{#J2 literal 0 HcmV?d00001 From 528c1f3ffd55a2c2b4dea4b29e29a047e1e4d6d0 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Tue, 12 Mar 2024 19:39:23 -0700 Subject: [PATCH 59/66] Test with seed-corpus entry of a zip file that has an empty stored file with an empty name --- fuzz/.gitignore | 1 + fuzz/corpus/seed/empty_stored.zip | Bin 0 -> 98 bytes 2 files changed, 1 insertion(+) create mode 100644 fuzz/corpus/seed/empty_stored.zip diff --git a/fuzz/.gitignore b/fuzz/.gitignore index a0925114..8d76f8b6 100644 --- a/fuzz/.gitignore +++ b/fuzz/.gitignore @@ -1,3 +1,4 @@ target corpus +!corpus/seed artifacts diff --git a/fuzz/corpus/seed/empty_stored.zip b/fuzz/corpus/seed/empty_stored.zip new file mode 100644 index 0000000000000000000000000000000000000000..0fc97befcad16db74fbbc72a0a278016e362615d GIT binary patch literal 98 ycmWIWW@Zs#0D(%8+z2oOi3sp!WYS~CEe}(=q!Gjl@MdKL(TqT-2c+dd90mYtU Date: Tue, 12 Mar 2024 19:48:03 -0700 Subject: [PATCH 60/66] Test with one-empty-file Zip files for compressed formats --- fuzz/corpus/seed/empty_Bzip2.zip | Bin 0 -> 112 bytes fuzz/corpus/seed/empty_Deflated.zip | Bin 0 -> 100 bytes fuzz/corpus/seed/empty_Zstd.zip | Bin 0 -> 107 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 fuzz/corpus/seed/empty_Bzip2.zip create mode 100644 fuzz/corpus/seed/empty_Deflated.zip create mode 100644 fuzz/corpus/seed/empty_Zstd.zip diff --git a/fuzz/corpus/seed/empty_Bzip2.zip b/fuzz/corpus/seed/empty_Bzip2.zip new file mode 100644 index 0000000000000000000000000000000000000000..af7aa1ada827379c3250769c449a58e74c94035f GIT binary patch literal 112 zcmWIWW@gc2U|`^3cp#b^0c0@nfe0vYipnq(FLJdAm;e$8@MdJvW5%r-rfW$fL^UfL Oh-L&rkRBZnhXDZDHwwJ~ literal 0 HcmV?d00001 diff --git a/fuzz/corpus/seed/empty_Deflated.zip b/fuzz/corpus/seed/empty_Deflated.zip new file mode 100644 index 0000000000000000000000000000000000000000..34473f96f641a0f43b8a075f34e1efee55f5a1ed GIT binary patch literal 100 zcmWIWW@Zs#U|`^2cp#b^0c0>Rfe0vIW(e?RWYS~CtpcWUNh63A;LXYgq8Wiu4@fJ3 GI1B)=QU^c) literal 0 HcmV?d00001 diff --git a/fuzz/corpus/seed/empty_Zstd.zip b/fuzz/corpus/seed/empty_Zstd.zip new file mode 100644 index 0000000000000000000000000000000000000000..a863e209407252a24d8798b8b7a5b021244a08e0 GIT binary patch literal 107 zcmWIWW@Zs#U|@)4cp#b^0c0?6f(R(k*sA|mfq{{MA;6oFNsk$~LYRgnjUZNlH!B;6 OW&}b#AgvDKFaQ9X2nr?u literal 0 HcmV?d00001 From e23a1aef49b2ba66e409fe208cb74bda963af240 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Tue, 12 Mar 2024 20:05:45 -0700 Subject: [PATCH 61/66] Add ZipCrypto-encrypted files to seed corpus --- fuzz/corpus/seed/empty_Bzip2_zipcrypto.zip | Bin 0 -> 124 bytes fuzz/corpus/seed/empty_Deflated_zipcrypto.zip | Bin 0 -> 112 bytes .../seed/{empty_stored.zip => empty_Stored.zip} | Bin fuzz/corpus/seed/empty_Stored_zipcrypto.zip | Bin 0 -> 110 bytes fuzz/corpus/seed/empty_Zstd_zipcrypto.zip | Bin 0 -> 119 bytes 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 fuzz/corpus/seed/empty_Bzip2_zipcrypto.zip create mode 100644 fuzz/corpus/seed/empty_Deflated_zipcrypto.zip rename fuzz/corpus/seed/{empty_stored.zip => empty_Stored.zip} (100%) create mode 100644 fuzz/corpus/seed/empty_Stored_zipcrypto.zip create mode 100644 fuzz/corpus/seed/empty_Zstd_zipcrypto.zip diff --git a/fuzz/corpus/seed/empty_Bzip2_zipcrypto.zip b/fuzz/corpus/seed/empty_Bzip2_zipcrypto.zip new file mode 100644 index 0000000000000000000000000000000000000000..1d8d624b71a88967acec600c5af829d2867d941f GIT binary patch literal 124 zcmWIWW@gc2U}WH7m@JVS!2kqOAOZ?jOYJ|}R_%VY_mk4@^TxIN|KF_sSHkdq{{D&p gZ$>6PX52bqCM;!nV*+4WS5b6PG3lN6^0LF6`sQ>@~ literal 0 HcmV?d00001 diff --git a/fuzz/corpus/seed/empty_Deflated_zipcrypto.zip b/fuzz/corpus/seed/empty_Deflated_zipcrypto.zip new file mode 100644 index 0000000000000000000000000000000000000000..2813649fbe534f651e7e92609b54108c4834f84d GIT binary patch literal 112 zcmWIWW@Zs#U}WH6m@JVS!2kq&AOZ?jOYJ|}R_%VY_mk4@KHmUuMkYOG+^S)^mNbG` T0p6@^Aes>f^?I1B(n1`;^{ literal 0 HcmV?d00001 From fe4ebedec4fac7e7c01ffbc018154dda7100044b Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Tue, 12 Mar 2024 20:07:40 -0700 Subject: [PATCH 62/66] Decrease to 20 million runs of fuzz_read, because seed corpus lowers exec/s but increases coverage plateau --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0738c0e9..d74f1ce3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- fuzz/corpus/seed -timeout=10s -fork=2 -runs=200000000 -max_len=600 -len_control=500 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- fuzz/corpus/seed -timeout=10s -fork=2 -runs=20000000 -max_len=600 -len_control=500 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 @@ -125,7 +125,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- fuzz/corpus/seed -timeout=10s -fork=2 -runs=1000000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- fuzz/corpus/seed -timeout=10s -fork=2 -runs=100000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 78e57bb6e137ffaff8c1fa9b0ac256599c1019a4 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Tue, 12 Mar 2024 20:15:40 -0700 Subject: [PATCH 63/66] Add ZIP64 examples to seed corpus --- fuzz/corpus/seed/empty_Bzip2_largefile.zip | Bin 0 -> 132 bytes fuzz/corpus/seed/empty_Deflated_largefile.zip | Bin 0 -> 120 bytes fuzz/corpus/seed/empty_Stored_largefile.zip | Bin 0 -> 118 bytes fuzz/corpus/seed/empty_Zstd_largefile.zip | Bin 0 -> 127 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 fuzz/corpus/seed/empty_Bzip2_largefile.zip create mode 100644 fuzz/corpus/seed/empty_Deflated_largefile.zip create mode 100644 fuzz/corpus/seed/empty_Stored_largefile.zip create mode 100644 fuzz/corpus/seed/empty_Zstd_largefile.zip diff --git a/fuzz/corpus/seed/empty_Bzip2_largefile.zip b/fuzz/corpus/seed/empty_Bzip2_largefile.zip new file mode 100644 index 0000000000000000000000000000000000000000..574a92f42082ffd9eeb988a67ea29e9534ac2bb2 GIT binary patch literal 132 zcmWIWW@gc2U|`^3xGb3)0c0@zhXMu$5e7yE0gw6P dW>gbkDxn&{)RIPsYF0K7%?N}bJq{oa0|17H65Id) literal 0 HcmV?d00001 diff --git a/fuzz/corpus/seed/empty_Deflated_largefile.zip b/fuzz/corpus/seed/empty_Deflated_largefile.zip new file mode 100644 index 0000000000000000000000000000000000000000..e8fa8c0f3b67cab7080bc69e19e64ee3a69564fe GIT binary patch literal 120 zcmWIWW@Zs#U|`^2xGb3)0c0@zhXMu$5e7yE0gw Date: Tue, 12 Mar 2024 20:16:23 -0700 Subject: [PATCH 64/66] Use 100 million iterations for fuzz_read --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d74f1ce3..46d48ba3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,7 +98,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run fuzz_read -- fuzz/corpus/seed -timeout=10s -fork=2 -runs=20000000 -max_len=600 -len_control=500 -dict=fuzz/fuzz.dict + cargo fuzz run fuzz_read -- fuzz/corpus/seed -timeout=10s -fork=2 -runs=100000000 -max_len=600 -len_control=500 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From 1bb1f8037c0edfc19cfb29c582e44a24af1975fe Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Tue, 12 Mar 2024 20:28:43 -0700 Subject: [PATCH 65/66] fuzz_read_no_features can still use 1 billion iterations --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 46d48ba3..59f89b9b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -125,7 +125,7 @@ jobs: - name: run fuzz timeout-minutes: 330 run: | - cargo fuzz run --no-default-features fuzz_read -- fuzz/corpus/seed -timeout=10s -fork=2 -runs=100000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict + cargo fuzz run --no-default-features fuzz_read -- fuzz/corpus/seed -timeout=10s -fork=2 -runs=1000000000 -max_len=16384 -len_control=10000 -dict=fuzz/fuzz.dict - name: Upload any failure inputs if: always() uses: actions/upload-artifact@v3 From f56121bf6d51d28033ef645b8198fb9a9f5b0eea Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Tue, 12 Mar 2024 20:53:44 -0700 Subject: [PATCH 66/66] Test using all inputs from unit/integ tests as part of the seed corpus --- fuzz/corpus/seed/aes_archive.zip | 1 + fuzz/corpus/seed/comment_garbage.zip | 1 + fuzz/corpus/seed/deflate64.zip | 1 + fuzz/corpus/seed/deflate64_issue_25.zip | 1 + fuzz/corpus/seed/files_and_dirs.zip | 1 + .../invalid_cde_number_of_files_allocation_greater_offset.zip | 1 + .../invalid_cde_number_of_files_allocation_smaller_offset.zip | 1 + fuzz/corpus/seed/invalid_offset.zip | 1 + fuzz/corpus/seed/invalid_offset2.zip | 1 + fuzz/corpus/seed/mimetype.zip | 1 + fuzz/corpus/seed/raw_deflate64_index_out_of_bounds.zip | 1 + fuzz/corpus/seed/zip64_demo.zip | 1 + fuzz/corpus/seed/zip64_magic_in_filename_1.zip | 1 + fuzz/corpus/seed/zip64_magic_in_filename_2.zip | 1 + fuzz/corpus/seed/zip64_magic_in_filename_3.zip | 1 + fuzz/corpus/seed/zip64_magic_in_filename_4.zip | 1 + fuzz/corpus/seed/zip64_magic_in_filename_5.zip | 1 + 17 files changed, 17 insertions(+) create mode 120000 fuzz/corpus/seed/aes_archive.zip create mode 120000 fuzz/corpus/seed/comment_garbage.zip create mode 120000 fuzz/corpus/seed/deflate64.zip create mode 120000 fuzz/corpus/seed/deflate64_issue_25.zip create mode 120000 fuzz/corpus/seed/files_and_dirs.zip create mode 120000 fuzz/corpus/seed/invalid_cde_number_of_files_allocation_greater_offset.zip create mode 120000 fuzz/corpus/seed/invalid_cde_number_of_files_allocation_smaller_offset.zip create mode 120000 fuzz/corpus/seed/invalid_offset.zip create mode 120000 fuzz/corpus/seed/invalid_offset2.zip create mode 120000 fuzz/corpus/seed/mimetype.zip create mode 120000 fuzz/corpus/seed/raw_deflate64_index_out_of_bounds.zip create mode 120000 fuzz/corpus/seed/zip64_demo.zip create mode 120000 fuzz/corpus/seed/zip64_magic_in_filename_1.zip create mode 120000 fuzz/corpus/seed/zip64_magic_in_filename_2.zip create mode 120000 fuzz/corpus/seed/zip64_magic_in_filename_3.zip create mode 120000 fuzz/corpus/seed/zip64_magic_in_filename_4.zip create mode 120000 fuzz/corpus/seed/zip64_magic_in_filename_5.zip diff --git a/fuzz/corpus/seed/aes_archive.zip b/fuzz/corpus/seed/aes_archive.zip new file mode 120000 index 00000000..03c268ca --- /dev/null +++ b/fuzz/corpus/seed/aes_archive.zip @@ -0,0 +1 @@ +../../../tests/data/aes_archive.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/comment_garbage.zip b/fuzz/corpus/seed/comment_garbage.zip new file mode 120000 index 00000000..5ed32871 --- /dev/null +++ b/fuzz/corpus/seed/comment_garbage.zip @@ -0,0 +1 @@ +../../../tests/data/comment_garbage.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/deflate64.zip b/fuzz/corpus/seed/deflate64.zip new file mode 120000 index 00000000..e3ac7b90 --- /dev/null +++ b/fuzz/corpus/seed/deflate64.zip @@ -0,0 +1 @@ +../../../tests/data/deflate64.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/deflate64_issue_25.zip b/fuzz/corpus/seed/deflate64_issue_25.zip new file mode 120000 index 00000000..6098769a --- /dev/null +++ b/fuzz/corpus/seed/deflate64_issue_25.zip @@ -0,0 +1 @@ +../../../tests/data/deflate64_issue_25.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/files_and_dirs.zip b/fuzz/corpus/seed/files_and_dirs.zip new file mode 120000 index 00000000..b4d40f44 --- /dev/null +++ b/fuzz/corpus/seed/files_and_dirs.zip @@ -0,0 +1 @@ +../../../tests/data/files_and_dirs.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/invalid_cde_number_of_files_allocation_greater_offset.zip b/fuzz/corpus/seed/invalid_cde_number_of_files_allocation_greater_offset.zip new file mode 120000 index 00000000..2e11137c --- /dev/null +++ b/fuzz/corpus/seed/invalid_cde_number_of_files_allocation_greater_offset.zip @@ -0,0 +1 @@ +../../../tests/data/invalid_cde_number_of_files_allocation_greater_offset.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/invalid_cde_number_of_files_allocation_smaller_offset.zip b/fuzz/corpus/seed/invalid_cde_number_of_files_allocation_smaller_offset.zip new file mode 120000 index 00000000..01b527a3 --- /dev/null +++ b/fuzz/corpus/seed/invalid_cde_number_of_files_allocation_smaller_offset.zip @@ -0,0 +1 @@ +../../../tests/data/invalid_cde_number_of_files_allocation_smaller_offset.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/invalid_offset.zip b/fuzz/corpus/seed/invalid_offset.zip new file mode 120000 index 00000000..4f8c160b --- /dev/null +++ b/fuzz/corpus/seed/invalid_offset.zip @@ -0,0 +1 @@ +../../../tests/data/invalid_offset.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/invalid_offset2.zip b/fuzz/corpus/seed/invalid_offset2.zip new file mode 120000 index 00000000..6dbace8b --- /dev/null +++ b/fuzz/corpus/seed/invalid_offset2.zip @@ -0,0 +1 @@ +../../../tests/data/invalid_offset2.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/mimetype.zip b/fuzz/corpus/seed/mimetype.zip new file mode 120000 index 00000000..0d372380 --- /dev/null +++ b/fuzz/corpus/seed/mimetype.zip @@ -0,0 +1 @@ +../../../tests/data/mimetype.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/raw_deflate64_index_out_of_bounds.zip b/fuzz/corpus/seed/raw_deflate64_index_out_of_bounds.zip new file mode 120000 index 00000000..54aa7863 --- /dev/null +++ b/fuzz/corpus/seed/raw_deflate64_index_out_of_bounds.zip @@ -0,0 +1 @@ +../../../tests/data/raw_deflate64_index_out_of_bounds.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/zip64_demo.zip b/fuzz/corpus/seed/zip64_demo.zip new file mode 120000 index 00000000..01619790 --- /dev/null +++ b/fuzz/corpus/seed/zip64_demo.zip @@ -0,0 +1 @@ +../../../tests/data/zip64_demo.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/zip64_magic_in_filename_1.zip b/fuzz/corpus/seed/zip64_magic_in_filename_1.zip new file mode 120000 index 00000000..f4e3d984 --- /dev/null +++ b/fuzz/corpus/seed/zip64_magic_in_filename_1.zip @@ -0,0 +1 @@ +../../../tests/data/zip64_magic_in_filename_1.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/zip64_magic_in_filename_2.zip b/fuzz/corpus/seed/zip64_magic_in_filename_2.zip new file mode 120000 index 00000000..52a969aa --- /dev/null +++ b/fuzz/corpus/seed/zip64_magic_in_filename_2.zip @@ -0,0 +1 @@ +../../../tests/data/zip64_magic_in_filename_2.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/zip64_magic_in_filename_3.zip b/fuzz/corpus/seed/zip64_magic_in_filename_3.zip new file mode 120000 index 00000000..11cc6a85 --- /dev/null +++ b/fuzz/corpus/seed/zip64_magic_in_filename_3.zip @@ -0,0 +1 @@ +../../../tests/data/zip64_magic_in_filename_3.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/zip64_magic_in_filename_4.zip b/fuzz/corpus/seed/zip64_magic_in_filename_4.zip new file mode 120000 index 00000000..b1d99ed6 --- /dev/null +++ b/fuzz/corpus/seed/zip64_magic_in_filename_4.zip @@ -0,0 +1 @@ +../../../tests/data/zip64_magic_in_filename_4.zip \ No newline at end of file diff --git a/fuzz/corpus/seed/zip64_magic_in_filename_5.zip b/fuzz/corpus/seed/zip64_magic_in_filename_5.zip new file mode 120000 index 00000000..611213e0 --- /dev/null +++ b/fuzz/corpus/seed/zip64_magic_in_filename_5.zip @@ -0,0 +1 @@ +../../../tests/data/zip64_magic_in_filename_5.zip \ No newline at end of file