Merge branch 'master' into dev/ziped
Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com>
This commit is contained in:
commit
5d3c73a5d5
3700 changed files with 5411 additions and 1690 deletions
30
.github/dependabot.yml
vendored
30
.github/dependabot.yml
vendored
|
@ -1,7 +1,27 @@
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: daily
|
interval: "daily"
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
|
commit-message:
|
||||||
|
prefix: "chore"
|
||||||
|
prefix-development: "test"
|
||||||
|
include: "scope"
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: "/fuzz"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
commit-message:
|
||||||
|
prefix: "test(fuzz)"
|
||||||
|
include: "scope"
|
||||||
|
- package-ecosystem: "github-actions" # See documentation for possible values
|
||||||
|
directory: "/" # Location of package manifests
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
commit-message:
|
||||||
|
prefix: "ci"
|
||||||
|
include: "scope"
|
23
.github/workflows/auto_merge_prs.yml
vendored
Normal file
23
.github/workflows/auto_merge_prs.yml
vendored
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
name: Auto-merge PRs from owner and trusted bots
|
||||||
|
on: pull_request
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-merge:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'github-actions' || github.actor == 'Pr0methean' }}
|
||||||
|
steps:
|
||||||
|
- name: Dependabot metadata
|
||||||
|
id: metadata
|
||||||
|
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||||
|
uses: dependabot/fetch-metadata@v2.1.0
|
||||||
|
with:
|
||||||
|
github-token: "${{ github.token }}"
|
||||||
|
- name: Enable auto-merge
|
||||||
|
run: gh pr merge --auto --merge "$PR_URL"
|
||||||
|
env:
|
||||||
|
PR_URL: ${{github.event.pull_request.html_url}}
|
||||||
|
GH_TOKEN: "${{ secrets.RELEASE_PLZ_PAT }}"
|
272
.github/workflows/ci.yaml
vendored
272
.github/workflows/ci.yaml
vendored
|
@ -2,91 +2,287 @@ name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
|
||||||
branches:
|
branches:
|
||||||
- master
|
- 'master'
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- 'gh-readonly-queue/**'
|
||||||
|
workflow_dispatch:
|
||||||
|
merge_group:
|
||||||
|
types: [checks_requested]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUSTFLAGS: -Dwarnings
|
RUSTFLAGS: -Dwarnings
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_and_test:
|
build_and_test:
|
||||||
name: Build and test
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macOS-latest, windows-latest]
|
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||||
rust: [stable, 1.59.0]
|
rustalias: [stable, nightly, msrv]
|
||||||
|
feature_flag: ["--all-features", "--no-default-features", ""]
|
||||||
|
include:
|
||||||
|
- rustalias: stable
|
||||||
|
rust: stable
|
||||||
|
- rustalias: msrv
|
||||||
|
rust: '1.70'
|
||||||
|
- rustalias: nightly
|
||||||
|
rust: nightly
|
||||||
|
name: 'Build and test ${{ matrix.feature_flag }}: ${{ matrix.os }}, ${{ matrix.rustalias }}'
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
|
|
||||||
- name: Install ${{ matrix.rust }}
|
- name: Install Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.rust }}
|
toolchain: ${{ matrix.rust }}
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
- name: check
|
- name: Check
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: check
|
command: check
|
||||||
args: --all --bins --examples
|
args: --all ${{ matrix.feature_flag }} --bins --examples
|
||||||
|
|
||||||
- name: tests
|
- name: Tests
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
args: --all
|
args: --all ${{ matrix.feature_flag }}
|
||||||
|
|
||||||
clippy:
|
cargo_fmt:
|
||||||
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
profile: minimal
|
profile: minimal
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
override: true
|
override: true
|
||||||
components: clippy
|
components: rustfmt
|
||||||
|
- name: fmt
|
||||||
|
run: cargo fmt --all -- --check
|
||||||
|
|
||||||
- name: clippy
|
style_and_docs:
|
||||||
uses: actions-rs/cargo@v1
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||||
with:
|
strategy:
|
||||||
command: clippy
|
matrix:
|
||||||
args: --all-targets --all-features -- -D warnings
|
feature_flag: ["--all-features", "--no-default-features", ""]
|
||||||
|
|
||||||
check_fmt_and_docs:
|
|
||||||
name: Checking fmt and docs
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v4
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
profile: minimal
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
components: rustfmt, clippy
|
|
||||||
override: true
|
override: true
|
||||||
|
components: clippy
|
||||||
|
- name: clippy
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
args: --all-targets ${{ matrix.feature_flag }} -- -D warnings
|
||||||
|
- name: docs
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: doc
|
||||||
|
args: --no-deps ${{ matrix.feature_flag }}
|
||||||
|
|
||||||
- name: fmt
|
fuzz_read:
|
||||||
run: cargo fmt --all -- --check
|
|
||||||
|
|
||||||
- name: Docs
|
|
||||||
run: cargo doc
|
|
||||||
|
|
||||||
fuzz:
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- build_and_test
|
||||||
|
- cargo_fmt
|
||||||
|
- style_and_docs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
profile: minimal
|
profile: minimal
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
override: true
|
override: true
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
- run: cargo install cargo-fuzz
|
with:
|
||||||
|
command: install
|
||||||
|
args: cargo-fuzz
|
||||||
- name: compile fuzz
|
- name: compile fuzz
|
||||||
run: |
|
uses: actions-rs/cargo@v1
|
||||||
cargo fuzz build fuzz_read
|
with:
|
||||||
|
command: fuzz
|
||||||
|
args: build --all-features fuzz_read
|
||||||
|
- name: run fuzz
|
||||||
|
timeout-minutes: 331
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fuzz
|
||||||
|
args: run --all-features fuzz_read -- fuzz/corpus/fuzz_read -timeout=10s -fork=2 -runs=25000000 -max_len=1300 -len_control=0 -dict=fuzz/fuzz.dict
|
||||||
|
- name: Upload any failure inputs
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: fuzz_read_bad_inputs
|
||||||
|
path: fuzz/artifacts/fuzz_read/crash-*
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Minimize seed corpus
|
||||||
|
if: always()
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fuzz
|
||||||
|
args: cmin --all-features fuzz_read fuzz/corpus/fuzz_read -- fuzz/corpus/new_seed
|
||||||
|
- name: Upload updated seed corpus
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: fuzz_read_corpus
|
||||||
|
path: fuzz/corpus/new_seed/*
|
||||||
|
|
||||||
|
fuzz_read_with_no_features:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- build_and_test
|
||||||
|
- cargo_fmt
|
||||||
|
- style_and_docs
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: nightly
|
||||||
|
override: true
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: install
|
||||||
|
args: cargo-fuzz
|
||||||
|
- name: compile fuzz
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fuzz
|
||||||
|
args: build --no-default-features fuzz_read
|
||||||
|
- name: run fuzz
|
||||||
|
timeout-minutes: 331
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fuzz
|
||||||
|
args: run --no-default-features fuzz_read fuzz/corpus/fuzz_read -- -timeout=10s -fork=2 -runs=40000000 -max_total_time=19800 -max_len=16384 -len_control=0 -dict=fuzz/fuzz.dict
|
||||||
|
- name: Upload any failure inputs
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: fuzz_read_no_features_bad_inputs
|
||||||
|
path: fuzz/artifacts/fuzz_read/crash-*
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Minimize seed corpus
|
||||||
|
if: always()
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fuzz
|
||||||
|
args: cmin --no-default-features fuzz_read fuzz/corpus/fuzz_read -- fuzz/corpus/new_seed
|
||||||
|
- name: Upload updated seed corpus
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: fuzz_read_no_features_corpus
|
||||||
|
path: fuzz/corpus/new_seed/*
|
||||||
|
|
||||||
|
fuzz_write:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- build_and_test
|
||||||
|
- cargo_fmt
|
||||||
|
- style_and_docs
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: nightly
|
||||||
|
override: true
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: install
|
||||||
|
args: cargo-fuzz
|
||||||
|
- name: compile fuzz
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fuzz
|
||||||
|
args: build --all-features fuzz_write
|
||||||
|
- name: run fuzz
|
||||||
|
timeout-minutes: 331
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fuzz
|
||||||
|
args: run --all-features fuzz_write fuzz/corpus/fuzz_write -- -timeout=2s -fork=2 -runs=1000000 -max_len=500 -dict=fuzz/fuzz.dict
|
||||||
|
- name: Upload any failure inputs
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: fuzz_write_bad_inputs
|
||||||
|
path: |
|
||||||
|
fuzz/artifacts/fuzz_write/crash-*
|
||||||
|
fuzz/artifacts/fuzz_write/leak-*
|
||||||
|
fuzz/artifacts/fuzz_write/timeout-*
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Minimize seed corpus
|
||||||
|
if: always()
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fuzz
|
||||||
|
args: cmin --all-features fuzz_write fuzz/corpus/fuzz_write -- fuzz/corpus/new_seed
|
||||||
|
- name: Upload updated seed corpus
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: fuzz_write_corpus
|
||||||
|
path: fuzz/corpus/new_seed/*
|
||||||
|
|
||||||
|
fuzz_write_with_no_features:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- build_and_test
|
||||||
|
- cargo_fmt
|
||||||
|
- style_and_docs
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: nightly
|
||||||
|
override: true
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: install
|
||||||
|
args: cargo-fuzz
|
||||||
|
- name: compile fuzz
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fuzz
|
||||||
|
args: build --no-default-features fuzz_write
|
||||||
|
- name: run fuzz
|
||||||
|
timeout-minutes: 331
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fuzz
|
||||||
|
args: run --no-default-features fuzz_write fuzz/corpus/fuzz_write -- -timeout=10s -fork=2 -runs=50000000 -max_len=10000 -len_control=200 -dict=fuzz/fuzz.dict
|
||||||
|
- name: Upload any failure inputs
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: fuzz_write_no_features_bad_inputs
|
||||||
|
path: fuzz/artifacts/fuzz_write/crash-*
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- name: Minimize seed corpus
|
||||||
|
if: always()
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fuzz
|
||||||
|
args: cmin --no-default-features fuzz_write fuzz/corpus/fuzz_write -- fuzz/corpus/new_seed
|
||||||
|
- name: Upload updated seed corpus
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: fuzz_write_no_features_corpus
|
||||||
|
path: fuzz/corpus/new_seed/*
|
||||||
|
|
37
.github/workflows/devskim.yml
vendored
Normal file
37
.github/workflows/devskim.yml
vendored
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
# This workflow uses actions that are not certified by GitHub.
|
||||||
|
# They are provided by a third-party and are governed by
|
||||||
|
# separate terms of service, privacy policy, and support
|
||||||
|
# documentation.
|
||||||
|
|
||||||
|
name: DevSkim
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "master" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "master" ]
|
||||||
|
schedule:
|
||||||
|
- cron: '39 17 * * *'
|
||||||
|
merge_group:
|
||||||
|
types: [checks_requested]
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: DevSkim
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run DevSkim scanner
|
||||||
|
uses: microsoft/DevSkim-Action@v1
|
||||||
|
|
||||||
|
- name: Upload DevSkim scan results to GitHub Security tab
|
||||||
|
uses: github/codeql-action/upload-sarif@v3
|
||||||
|
with:
|
||||||
|
sarif_file: devskim-results.sarif
|
28
.github/workflows/release-plz.yml
vendored
Normal file
28
.github/workflows/release-plz.yml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
name: Release
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
|
jobs:
|
||||||
|
release-plz:
|
||||||
|
name: Release-plz
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
token: ${{ secrets.RELEASE_PLZ_PAT }}
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: nightly
|
||||||
|
override: true
|
||||||
|
profile: minimal
|
||||||
|
- name: Run release-plz
|
||||||
|
uses: MarcoIeni/release-plz-action@v0.5
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_PAT }}
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
target
|
target
|
||||||
|
.DS_Store
|
||||||
\.idea/
|
\.idea/
|
||||||
|
|
14
.whitesource
Normal file
14
.whitesource
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"scanSettings": {
|
||||||
|
"baseBranches": []
|
||||||
|
},
|
||||||
|
"checkRunSettings": {
|
||||||
|
"vulnerableCheckRunConclusionLevel": "failure",
|
||||||
|
"displayMode": "diff",
|
||||||
|
"useMendCheckNames": true
|
||||||
|
},
|
||||||
|
"issueSettings": {
|
||||||
|
"minSeverityLevel": "LOW",
|
||||||
|
"issueType": "DEPENDENCY"
|
||||||
|
}
|
||||||
|
}
|
352
CHANGELOG.md
352
CHANGELOG.md
|
@ -1,14 +1,360 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.2.2](https://github.com/zip-rs/zip2/compare/v1.2.1...v1.2.2) - 2024-05-09
|
||||||
|
|
||||||
|
### <!-- 1 -->🐛 Bug Fixes
|
||||||
|
- Failed to clear "writing_raw" before finishing a symlink, leading to dropped extra fields
|
||||||
|
|
||||||
|
### <!-- 4 -->⚡ Performance
|
||||||
|
- Use boxed slice for archive comment, since it can't be concatenated
|
||||||
|
- Optimize for the fact that false signatures can't overlap with real ones
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/zip-rs/zip2/compare/v1.2.0...v1.2.1) - 2024-05-06
|
||||||
|
|
||||||
|
### <!-- 1 -->🐛 Bug Fixes
|
||||||
|
- Prevent panic when trying to read a file with an unsupported compression method
|
||||||
|
- Prevent panic after reading an invalid LZMA file
|
||||||
|
- Make `Stored` the default compression method if `Deflated` isn't available, so that zip files are readable by as much software as possible
|
||||||
|
- version_needed was wrong when e.g. cfg(bzip2) but current file wasn't bzip2 ([#100](https://github.com/zip-rs/zip2/pull/100))
|
||||||
|
- file paths shouldn't start with slashes ([#102](https://github.com/zip-rs/zip2/pull/102))
|
||||||
|
|
||||||
|
### <!-- 2 -->🚜 Refactor
|
||||||
|
- Overhaul `impl Arbitrary for FileOptions`
|
||||||
|
- Remove unused `atomic` module
|
||||||
|
|
||||||
|
## [1.2.0](https://github.com/zip-rs/zip2/compare/v1.1.4...v1.2.0) - 2024-05-06
|
||||||
|
|
||||||
|
### <!-- 0 -->🚀 Features
|
||||||
|
- Add method `decompressed_size()` so non-recursive ZIP bombs can be detected
|
||||||
|
|
||||||
|
### <!-- 2 -->🚜 Refactor
|
||||||
|
- Make `ZipWriter::finish()` consume the `ZipWriter`
|
||||||
|
|
||||||
|
### <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
- Use panic! rather than abort to ensure the fuzz harness can process the failure
|
||||||
|
- Update fuzz_write to use replace_with
|
||||||
|
- Remove a drop that can no longer be explicit
|
||||||
|
- Add `#![allow(unexpected_cfgs)]` in nightly
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/zip-rs/zip2/compare/v1.1.3...v1.1.4) - 2024-05-04
|
||||||
|
|
||||||
|
### <!-- 1 -->🐛 Bug Fixes
|
||||||
|
- Build was failing with bzip2 enabled
|
||||||
|
- use is_dir in more places where Windows paths might be handled incorrectly
|
||||||
|
|
||||||
|
### <!-- 4 -->⚡ Performance
|
||||||
|
- Quick filter for paths that contain "/../" or "/./" or start with "./" or "../"
|
||||||
|
- Fast handling for separator-free paths
|
||||||
|
- Speed up logic if main separator isn't '/'
|
||||||
|
- Drop `normalized_components` slightly sooner when not using it
|
||||||
|
- Speed up `path_to_string` in cases where the path is already in the proper format
|
||||||
|
|
||||||
|
### <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
- Refactor: can short-circuit handling of paths that start with MAIN_SEPARATOR, no matter what MAIN_SEPARATOR is
|
||||||
|
- Bug fix: non-canonical path detection when MAIN_SEPARATOR is not slash or occurs twice in a row
|
||||||
|
- Bug fix: must recreate if . or .. is a path element
|
||||||
|
- Bug fix
|
||||||
|
|
||||||
|
### <!-- 9 -->◀️ Revert
|
||||||
|
- [#58](https://github.com/zip-rs/zip2/pull/58) (partial): `bzip2-rs` can't replace `bzip2` because it's decompress-only
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/zip-rs/zip2/compare/v1.1.2...v1.1.3) - 2024-04-30
|
||||||
|
|
||||||
|
### <!-- 1 -->🐛 Bug Fixes
|
||||||
|
- Rare bug where find_and_parse would give up prematurely on detecting a false end-of-CDR header
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/Pr0methean/zip/compare/v1.1.1...v1.1.2) - 2024-04-28
|
||||||
|
|
||||||
|
### <!-- 1 -->🐛 Bug Fixes
|
||||||
|
- Alignment was previously handled incorrectly ([#33](https://github.com/Pr0methean/zip/pull/33))
|
||||||
|
|
||||||
|
### <!-- 2 -->🚜 Refactor
|
||||||
|
- deprecate `deflate-miniz` feature since it's now equivalent to `deflate` ([#35](https://github.com/Pr0methean/zip/pull/35))
|
||||||
|
|
||||||
|
## [1.1.1]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `index_for_name`, `index_for_path`, `name_for_index`: get the index of a file given its path or vice-versa, without
|
||||||
|
initializing metadata from the local-file header or needing to mutably borrow the `ZipArchive`.
|
||||||
|
- `add_symlink_from_path`, `shallow_copy_file_from_path`, `deep_copy_file_from_path`, `raw_copy_file_to_path`: copy a
|
||||||
|
file or create a symlink using `AsRef<Path>` arguments
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- `add_directory_from_path` and `start_file_from_path` are no longer deprecated, and they now normalize `..` as well as
|
||||||
|
`.`.
|
||||||
|
|
||||||
|
## [1.1.0]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Support for decoding LZMA.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Eliminated a custom `AtomicU64` type by replacing it with `OnceLock` in the only place it's used.
|
||||||
|
- `FileOptions` now has the subtype `SimpleFileOptions` which implements `Copy` but has no extra data.
|
||||||
|
|
||||||
|
## [1.0.1]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- The published package on crates.io no longer includes the tests or examples.
|
||||||
|
|
||||||
|
## [1.0.0]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Now uses boxed slices rather than `String` or `Vec` for metadata fields that aren't likely to grow.
|
||||||
|
|
||||||
|
## [0.11.0]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Support for `DEFLATE64` (decompression only).
|
||||||
|
- Support for Zopfli compression levels up to `i64::MAX`.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- `InvalidPassword` is now a kind of `ZipError` to eliminate the need for nested `Result` structs.
|
||||||
|
- Updated dependencies.
|
||||||
|
|
||||||
|
## [0.10.3]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated dependencies.
|
||||||
|
- MSRV increased to `1.67`.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed some rare bugs that could cause panics when trying to read an invalid ZIP file or using an incorrect password.
|
||||||
|
|
||||||
|
## [0.10.2]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Where possible, methods are now `const`. This improves performance, especially when reading.
|
||||||
|
|
||||||
|
## [0.10.1]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Date and time conversion methods now return `DateTimeRangeError` rather than `()` on error.
|
||||||
|
|
||||||
|
## [0.10.0]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Replaces the `flush_on_finish_file` parameter of `ZipWriter::new` and `ZipWriter::Append` with
|
||||||
|
a `set_flush_on_finish_file` method.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixes build errors that occur when all default features are disabled.
|
||||||
|
- Fixes more cases of a bug when ZIP64 magic bytes occur in filenames.
|
||||||
|
|
||||||
|
## [0.9.2]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `zlib-ng` for fast Deflate compression. This is now the default for compression levels 0-9.
|
||||||
|
- `chrono` to convert zip::DateTime to and from chrono::NaiveDateTime
|
||||||
|
|
||||||
|
## [0.9.1]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Zopfli for aggressive Deflate compression.
|
||||||
|
|
||||||
|
## [0.9.0]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `flush_on_finish_file` parameter for `ZipWriter`.
|
||||||
|
|
||||||
|
## [0.8.3]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Uses the `aes::cipher::KeyInit` trait from `aes` 0.8.2 where appropriate.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Calling `abort_file()` no longer corrupts the archive if called on a
|
||||||
|
shallow copy of a remaining file, or on an archive whose CDR entries are out
|
||||||
|
of sequence. However, it may leave an unused entry in the archive.
|
||||||
|
- Calling `abort_file()` while writing a ZipCrypto-encrypted file no longer
|
||||||
|
causes a crash.
|
||||||
|
- Calling `abort_file()` on the last file before `finish()` no longer produces
|
||||||
|
an invalid ZIP file or garbage in the comment.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `ZipWriter` methods `get_comment()` and `get_raw_comment()`.
|
||||||
|
|
||||||
|
## [0.8.2]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed an issue where code might spuriously fail during write fuzzing.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- New method `with_alignment` on `FileOptions`.
|
||||||
|
|
||||||
|
## [0.8.1]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- `ZipWriter` now once again implements `Send` if the underlying writer does.
|
||||||
|
|
||||||
|
## [0.8.0]
|
||||||
|
|
||||||
|
### Deleted
|
||||||
|
|
||||||
|
- Methods `start_file_aligned`, `start_file_with_extra_data`, `end_local_start_central_extra_data` and
|
||||||
|
`end_extra_data` (see below).
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Alignment and extra-data fields are now attributes of [`zip::unstable::write::FileOptions`], allowing them to be
|
||||||
|
specified for `add_directory` and `add_symlink`.
|
||||||
|
- Extra-data fields are now formatted by the `FileOptions` method `add_extra_data`.
|
||||||
|
- Improved performance, especially for `shallow_copy_file` and `deep_copy_file` on files with extra data.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixes a rare bug where the size of the extra-data field could overflow when `large_file` was set.
|
||||||
|
- Fixes more cases of a bug when ZIP64 magic bytes occur in filenames.
|
||||||
|
|
||||||
|
## [0.7.5]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed a bug that occurs when ZIP64 magic bytes occur twice in a filename or across two filenames.
|
||||||
|
|
||||||
|
## [0.7.4]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added experimental [`zip::unstable::write::FileOptions::with_deprecated_encryption`] API to enable encrypting
|
||||||
|
files with PKWARE encryption.
|
||||||
|
|
||||||
|
## [0.7.3]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed a bug that occurs when a filename in a ZIP32 file includes the ZIP64 magic bytes.
|
||||||
|
|
||||||
|
## [0.7.2]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Method `abort_file` - removes the current or most recently-finished file from the archive.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed a bug where a file could remain open for writing after validations failed.
|
||||||
|
|
||||||
|
## [0.7.1]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Bumped the version number in order to upload an updated README to crates.io.
|
||||||
|
|
||||||
|
## [0.7.0]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Calling `start_file` with invalid parameters no longer closes the `ZipWriter`.
|
||||||
|
- Attempting to write a 4GiB file without calling `FileOptions::large_file(true)` now removes the file from the archive
|
||||||
|
but does not close the `ZipWriter`.
|
||||||
|
- Attempting to write a file with an unrepresentable or invalid last-modified date will instead add it with a date of
|
||||||
|
1980-01-01 00:00:00.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Method `is_writing_file` - indicates whether a file is open for writing.
|
||||||
|
|
||||||
|
## [0.6.13]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed a possible bug in deep_copy_file.
|
||||||
|
|
||||||
|
## [0.6.12]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed a Clippy warning that was missed during the last release.
|
||||||
|
|
||||||
|
## [0.6.11]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed a bug that could cause later writes to fail after a `deep_copy_file` call.
|
||||||
|
|
||||||
|
## [0.6.10]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated dependency versions.
|
||||||
|
|
||||||
|
## [0.6.9]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed an issue that prevented `ZipWriter` from implementing `Send`.
|
||||||
|
|
||||||
|
## [0.6.8]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Detects duplicate filenames.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- `deep_copy_file` could set incorrect Unix permissions.
|
||||||
|
- `deep_copy_file` could handle files incorrectly if their compressed size was u32::MAX bytes or less but their
|
||||||
|
uncompressed size was not.
|
||||||
|
- Documented that `deep_copy_file` does not copy a directory's contents.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Improved performance of `deep_copy_file` by using a HashMap and eliminating a redundant search.
|
||||||
|
|
||||||
|
## [0.6.7]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `deep_copy_file` method: more standards-compliant way to copy a file from within the ZipWriter
|
||||||
|
|
||||||
|
## [0.6.6]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Unused flag `#![feature(read_buf)]` was breaking compatibility with stable compiler.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated `aes` dependency to `0.8.2` (https://github.com/zip-rs/zip/pull/354)
|
||||||
|
- Updated other dependency versions.
|
||||||
|
|
||||||
## [0.6.5]
|
## [0.6.5]
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Added experimental [`zip::unstable::write::FileOptions::with_deprecated_encryption`] API to enable encrypting files with PKWARE encryption.
|
- Added experimental [`zip::unstable::write::FileOptions::with_deprecated_encryption`] API to enable encrypting files with PKWARE encryption.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `shallow_copy_file` method: copy a file from within the ZipWriter
|
||||||
|
|
||||||
|
|
||||||
## [0.6.4]
|
## [0.6.4]
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- [#333](https://github.com/zip-rs/zip/pull/333): disabled the default features of the `time` dependency, and also `formatting` and `macros`, as they were enabled by mistake.
|
- [#333](https://github.com/zip-rs/zip/pull/333): disabled the default features of the `time` dependency, and also `formatting` and `macros`, as they were enabled by mistake.
|
||||||
- Deprecated [`DateTime::from_time`](https://docs.rs/zip/0.6/zip/struct.DateTime.html#method.from_time) in favor of [`DateTime::try_from`](https://docs.rs/zip/0.6/zip/struct.DateTime.html#impl-TryFrom-for-DateTime)
|
- Deprecated [`DateTime::from_time`](https://docs.rs/zip/0.6/zip/struct.DateTime.html#method.from_time) in favor of [`DateTime::try_from`](https://docs.rs/zip/0.6/zip/struct.DateTime.html#impl-TryFrom-for-DateTime)
|
||||||
|
|
||||||
|
|
7
CONTRIBUTING.md
Normal file
7
CONTRIBUTING.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Pull requests are welcome, but they're subject to some requirements:
|
||||||
|
|
||||||
|
* They must build against the MSRV, the latest stable Rust version, and the nightly Rust version, both with `--no-default-features` and with `--all-features`.
|
||||||
|
* They must pass fuzz tests (see the Actions tab).
|
||||||
|
* Commit messages must conform to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) and start with
|
||||||
|
one of the types specified by the [Angular convention](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type).
|
||||||
|
* All commits must be signed.
|
93
Cargo.toml
93
Cargo.toml
|
@ -1,45 +1,88 @@
|
||||||
[package]
|
[package]
|
||||||
name = "zip"
|
name = "zip"
|
||||||
version = "0.6.5"
|
version = "1.2.2"
|
||||||
authors = ["Mathijs van de Nes <git@mathijs.vd-nes.nl>", "Marli Frost <marli@frost.red>", "Ryan Levick <ryan.levick@gmail.com>"]
|
authors = [
|
||||||
|
"Mathijs van de Nes <git@mathijs.vd-nes.nl>",
|
||||||
|
"Marli Frost <marli@frost.red>",
|
||||||
|
"Ryan Levick <ryan.levick@gmail.com>",
|
||||||
|
"Chris Hennick <hennickc@amazon.com>",
|
||||||
|
]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/zip-rs/zip.git"
|
repository = "https://github.com/zip-rs/zip2.git"
|
||||||
keywords = ["zip", "archive"]
|
keywords = ["zip", "archive"]
|
||||||
|
rust-version = "1.70.0"
|
||||||
description = """
|
description = """
|
||||||
Library to support the reading and writing of zip files.
|
Library to support the reading and writing of zip files.
|
||||||
"""
|
"""
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.59.0"
|
exclude = ["tests/**", "examples/**", ".github/**", "fuzz/**"]
|
||||||
|
build = "src/build.rs"
|
||||||
|
|
||||||
|
[workspace.dependencies]
|
||||||
|
time = { version = "0.3.36", default-features = false }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
aes = { version = "0.7.5", optional = true }
|
aes = { version = "0.8.4", optional = true }
|
||||||
byteorder = "1.4.3"
|
bzip2 = { version = "0.4.4", optional = true }
|
||||||
bzip2 = { version = "0.4.3", optional = true }
|
chrono = { version = "0.4.38", optional = true }
|
||||||
constant_time_eq = { version = "0.1.5", optional = true }
|
constant_time_eq = { version = "0.3.0", optional = true }
|
||||||
crc32fast = "1.3.2"
|
crc32fast = "1.4.0"
|
||||||
flate2 = { version = "1.0.23", default-features = false, optional = true }
|
displaydoc = { version = "0.2.4", default-features = false }
|
||||||
|
flate2 = { version = "1.0.28", default-features = false, optional = true }
|
||||||
|
indexmap = "2"
|
||||||
hmac = { version = "0.12.1", optional = true, features = ["reset"] }
|
hmac = { version = "0.12.1", optional = true, features = ["reset"] }
|
||||||
pbkdf2 = {version = "0.11.0", optional = true }
|
pbkdf2 = { version = "0.12.2", optional = true }
|
||||||
sha1 = {version = "0.10.1", optional = true }
|
rand = { version = "0.8.5", optional = true }
|
||||||
time = { version = "0.3.7", optional = true, default-features = false, features = ["std"] }
|
sha1 = { version = "0.10.6", optional = true }
|
||||||
zstd = { version = "0.11.2", optional = true }
|
thiserror = "1.0.48"
|
||||||
|
time = { workspace = true, optional = true, features = [
|
||||||
|
"std",
|
||||||
|
] }
|
||||||
|
zeroize = { version = "1.6.0", optional = true, features = ["zeroize_derive"] }
|
||||||
|
zstd = { version = "0.13.1", optional = true, default-features = false }
|
||||||
|
zopfli = { version = "0.8.0", optional = true }
|
||||||
|
deflate64 = { version = "0.1.8", optional = true }
|
||||||
|
lzma-rs = { version = "0.3.0", default-features = false, optional = true }
|
||||||
|
|
||||||
[target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies]
|
[target.'cfg(any(all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc"))'.dependencies]
|
||||||
crossbeam-utils = "0.8.8"
|
crossbeam-utils = "0.8.19"
|
||||||
|
|
||||||
|
[target.'cfg(fuzzing)'.dependencies]
|
||||||
|
arbitrary = { version = "1.3.2", features = ["derive"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
bencher = "0.1.5"
|
bencher = "0.1.5"
|
||||||
getrandom = "0.2.5"
|
getrandom = { version = "0.2.14", features = ["js"] }
|
||||||
walkdir = "2.3.2"
|
walkdir = "2.5.0"
|
||||||
time = { version = "0.3.7", features = ["formatting", "macros"] }
|
time = { workspace = true, features = ["formatting", "macros"] }
|
||||||
|
anyhow = "1"
|
||||||
|
clap = { version = "=4.4.18", features = ["derive"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
aes-crypto = [ "aes", "constant_time_eq", "hmac", "pbkdf2", "sha1" ]
|
aes-crypto = ["aes", "constant_time_eq", "hmac", "pbkdf2", "sha1", "rand", "zeroize"]
|
||||||
deflate = ["flate2/rust_backend"]
|
chrono = ["chrono/default"]
|
||||||
deflate-miniz = ["flate2/default"]
|
_deflate-any = []
|
||||||
deflate-zlib = ["flate2/zlib"]
|
deflate = ["flate2/rust_backend", "_deflate-any"]
|
||||||
|
|
||||||
|
# DEPRECATED: previously enabled `flate2/miniz_oxide` which is equivalent to `flate2/rust_backend`
|
||||||
|
deflate-miniz = ["deflate", "_deflate-any"]
|
||||||
|
|
||||||
|
deflate-zlib = ["flate2/zlib", "_deflate-any"]
|
||||||
|
deflate-zlib-ng = ["flate2/zlib-ng", "_deflate-any"]
|
||||||
|
deflate-zopfli = ["zopfli", "_deflate-any"]
|
||||||
|
lzma = ["lzma-rs/stream"]
|
||||||
unreserved = []
|
unreserved = []
|
||||||
default = ["aes-crypto", "bzip2", "deflate", "time", "zstd"]
|
default = [
|
||||||
|
"aes-crypto",
|
||||||
|
"bzip2",
|
||||||
|
"deflate",
|
||||||
|
"deflate64",
|
||||||
|
"deflate-zlib-ng",
|
||||||
|
"deflate-zopfli",
|
||||||
|
"lzma",
|
||||||
|
"time",
|
||||||
|
"zstd",
|
||||||
|
]
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
name = "read_entry"
|
name = "read_entry"
|
||||||
|
@ -48,3 +91,7 @@ harness = false
|
||||||
[[bench]]
|
[[bench]]
|
||||||
name = "read_metadata"
|
name = "read_metadata"
|
||||||
harness = false
|
harness = false
|
||||||
|
|
||||||
|
[[bench]]
|
||||||
|
name = "merge_archive"
|
||||||
|
harness = false
|
||||||
|
|
61
README.md
61
README.md
|
@ -1,67 +1,65 @@
|
||||||
zip-rs
|
zip
|
||||||
======
|
========
|
||||||
|
|
||||||
[](https://github.com/zip-rs/zip/actions?query=branch%3Amaster+workflow%3ACI)
|
[](https://github.com/Pr0methean/zip/actions?query=branch%3Amaster+workflow%3ACI)
|
||||||
[](https://crates.io/crates/zip)
|
[](https://crates.io/crates/zip)
|
||||||
[](https://discord.gg/rQ7H9cSsF4)
|
|
||||||
|
|
||||||
[Documentation](https://docs.rs/zip/0.6.3/zip/)
|
[Documentation](https://docs.rs/zip/latest/zip/)
|
||||||
|
|
||||||
Info
|
Info
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
||||||
A zip library for rust which supports reading and writing of simple ZIP files.
|
A zip library for rust which supports reading and writing of simple ZIP files. Formerly hosted at
|
||||||
|
https://github.com/zip-rs/zip2.
|
||||||
|
|
||||||
Supported compression formats:
|
Supported compression formats:
|
||||||
|
|
||||||
* stored (i.e. none)
|
* stored (i.e. none)
|
||||||
* deflate
|
* deflate
|
||||||
|
* deflate64 (decompression only)
|
||||||
* bzip2
|
* bzip2
|
||||||
* zstd
|
* zstd
|
||||||
|
* lzma (decompression only)
|
||||||
|
|
||||||
Currently unsupported zip extensions:
|
Currently unsupported zip extensions:
|
||||||
|
|
||||||
* Encryption
|
|
||||||
* Multi-disk
|
* Multi-disk
|
||||||
|
|
||||||
Usage
|
Features
|
||||||
-----
|
--------
|
||||||
|
|
||||||
With all default features:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[dependencies]
|
|
||||||
zip = "5"
|
|
||||||
```
|
|
||||||
|
|
||||||
Without the default features:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[dependencies]
|
|
||||||
zip = { version = "0.6.5", default-features = false }
|
|
||||||
```
|
|
||||||
|
|
||||||
The features available are:
|
The features available are:
|
||||||
|
|
||||||
* `aes-crypto`: Enables decryption of files which were encrypted with AES. Supports AE-1 and AE-2 methods.
|
* `aes-crypto`: Enables decryption of files which were encrypted with AES. Supports AE-1 and AE-2 methods.
|
||||||
* `deflate`: Enables the deflate compression algorithm, which is the default for zip files.
|
* `deflate`: Enables decompressing the deflate compression algorithm, which is the default for zip files.
|
||||||
|
* `deflate-zlib`: Enables deflating files with the `zlib` library (used when compression quality is 0..=9).
|
||||||
|
* `deflate-zlib-ng`: Enables deflating files with the `zlib-ng` library (used when compression quality is 0..=9).
|
||||||
|
This is the fastest `deflate` implementation available.
|
||||||
|
* `deflate-zopfli`: Enables deflating files with the `zopfli` library (used when compression quality is 10..=264). This
|
||||||
|
is the most effective `deflate` implementation available.
|
||||||
|
* `deflate64`: Enables the deflate64 compression algorithm. Only decompression is supported.
|
||||||
|
* `lzma`: Enables the LZMA compression algorithm. Only decompression is supported.
|
||||||
* `bzip2`: Enables the BZip2 compression algorithm.
|
* `bzip2`: Enables the BZip2 compression algorithm.
|
||||||
* `time`: Enables features using the [time](https://github.com/rust-lang-deprecated/time) crate.
|
* `time`: Enables features using the [time](https://github.com/rust-lang-deprecated/time) crate.
|
||||||
|
* `chrono`: Enables converting last-modified `zip::DateTime` to and from `chrono::NaiveDateTime`.
|
||||||
* `zstd`: Enables the Zstandard compression algorithm.
|
* `zstd`: Enables the Zstandard compression algorithm.
|
||||||
|
|
||||||
All of these are enabled by default.
|
By default `aes-crypto`, `deflate`, `deflate-zlib-ng`, `deflate-zopfli`, `bzip2`, `time` and `zstd` are enabled.
|
||||||
|
|
||||||
|
The following feature flags are deprecated:
|
||||||
|
|
||||||
|
* `deflate-miniz`: Use `flate2`'s default backend for compression. Currently the same as `deflate`.
|
||||||
|
|
||||||
MSRV
|
MSRV
|
||||||
----
|
----
|
||||||
|
|
||||||
Our current Minimum Supported Rust Version is **1.59.0**. When adding features,
|
Our current Minimum Supported Rust Version is **1.70**. When adding features,
|
||||||
we will follow these guidelines:
|
we will follow these guidelines:
|
||||||
|
|
||||||
- We will always support the latest four minor Rust versions. This gives you a 6
|
- We will always support the latest four minor Rust versions. This gives you a 6
|
||||||
month window to upgrade your compiler.
|
month window to upgrade your compiler.
|
||||||
- Any change to the MSRV will be accompanied with a **minor** version bump
|
- Any change to the MSRV will be accompanied with a **minor** version bump.
|
||||||
- While the crate is pre-1.0, this will be a change to the PATCH version.
|
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
@ -72,6 +70,7 @@ See the [examples directory](examples) for:
|
||||||
* How to extract a zip file.
|
* How to extract a zip file.
|
||||||
* How to extract a single file from a zip.
|
* How to extract a single file from a zip.
|
||||||
* How to read a zip from the standard input.
|
* How to read a zip from the standard input.
|
||||||
|
* How to append a directory to an existing archive
|
||||||
|
|
||||||
Fuzzing
|
Fuzzing
|
||||||
-------
|
-------
|
||||||
|
@ -93,3 +92,9 @@ To start fuzzing zip extraction:
|
||||||
```bash
|
```bash
|
||||||
cargo +nightly fuzz run fuzz_read
|
cargo +nightly fuzz run fuzz_read
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To start fuzzing zip creation:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cargo +nightly fuzz run fuzz_write
|
||||||
|
```
|
||||||
|
|
131
benches/merge_archive.rs
Normal file
131
benches/merge_archive.rs
Normal file
|
@ -0,0 +1,131 @@
|
||||||
|
use bencher::{benchmark_group, benchmark_main};
|
||||||
|
|
||||||
|
use std::io::{Cursor, Read, Seek, Write};
|
||||||
|
|
||||||
|
use bencher::Bencher;
|
||||||
|
use getrandom::getrandom;
|
||||||
|
use zip::{result::ZipResult, write::SimpleFileOptions, ZipArchive, ZipWriter};
|
||||||
|
|
||||||
|
fn generate_random_archive(
|
||||||
|
num_entries: usize,
|
||||||
|
entry_size: usize,
|
||||||
|
options: SimpleFileOptions,
|
||||||
|
) -> ZipResult<(usize, ZipArchive<Cursor<Vec<u8>>>)> {
|
||||||
|
let buf = Cursor::new(Vec::new());
|
||||||
|
let mut zip = ZipWriter::new(buf);
|
||||||
|
|
||||||
|
let mut bytes = vec![0u8; entry_size];
|
||||||
|
for i in 0..num_entries {
|
||||||
|
let name = format!("random{}.dat", i);
|
||||||
|
zip.start_file(name, options)?;
|
||||||
|
getrandom(&mut bytes).unwrap();
|
||||||
|
zip.write_all(&bytes)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
let buf = zip.finish()?.into_inner();
|
||||||
|
let len = buf.len();
|
||||||
|
|
||||||
|
Ok((len, ZipArchive::new(Cursor::new(buf))?))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn perform_merge<R: Read + Seek, W: Write + Seek>(
|
||||||
|
src: ZipArchive<R>,
|
||||||
|
mut target: ZipWriter<W>,
|
||||||
|
) -> ZipResult<ZipWriter<W>> {
|
||||||
|
target.merge_archive(src)?;
|
||||||
|
Ok(target)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn perform_raw_copy_file<R: Read + Seek, W: Write + Seek>(
|
||||||
|
mut src: ZipArchive<R>,
|
||||||
|
mut target: ZipWriter<W>,
|
||||||
|
) -> ZipResult<ZipWriter<W>> {
|
||||||
|
for i in 0..src.len() {
|
||||||
|
let entry = src.by_index(i)?;
|
||||||
|
target.raw_copy_file(entry)?;
|
||||||
|
}
|
||||||
|
Ok(target)
|
||||||
|
}
|
||||||
|
|
||||||
|
const NUM_ENTRIES: usize = 100;
|
||||||
|
const ENTRY_SIZE: usize = 1024;
|
||||||
|
|
||||||
|
fn merge_archive_stored(bench: &mut Bencher) {
|
||||||
|
let options = SimpleFileOptions::default().compression_method(zip::CompressionMethod::Stored);
|
||||||
|
let (len, src) = generate_random_archive(NUM_ENTRIES, ENTRY_SIZE, options).unwrap();
|
||||||
|
|
||||||
|
bench.bytes = len as u64;
|
||||||
|
|
||||||
|
bench.iter(|| {
|
||||||
|
let buf = Cursor::new(Vec::new());
|
||||||
|
let zip = ZipWriter::new(buf);
|
||||||
|
let zip = perform_merge(src.clone(), zip).unwrap();
|
||||||
|
let buf = zip.finish().unwrap().into_inner();
|
||||||
|
assert_eq!(buf.len(), len);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "_deflate-any")]
|
||||||
|
fn merge_archive_compressed(bench: &mut Bencher) {
|
||||||
|
let options = SimpleFileOptions::default().compression_method(zip::CompressionMethod::Deflated);
|
||||||
|
let (len, src) = generate_random_archive(NUM_ENTRIES, ENTRY_SIZE, options).unwrap();
|
||||||
|
|
||||||
|
bench.bytes = len as u64;
|
||||||
|
|
||||||
|
bench.iter(|| {
|
||||||
|
let buf = Cursor::new(Vec::new());
|
||||||
|
let zip = ZipWriter::new(buf);
|
||||||
|
let zip = perform_merge(src.clone(), zip).unwrap();
|
||||||
|
let buf = zip.finish().unwrap().into_inner();
|
||||||
|
assert_eq!(buf.len(), len);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
fn merge_archive_raw_copy_file_stored(bench: &mut Bencher) {
|
||||||
|
let options = SimpleFileOptions::default().compression_method(zip::CompressionMethod::Stored);
|
||||||
|
let (len, src) = generate_random_archive(NUM_ENTRIES, ENTRY_SIZE, options).unwrap();
|
||||||
|
|
||||||
|
bench.bytes = len as u64;
|
||||||
|
|
||||||
|
bench.iter(|| {
|
||||||
|
let buf = Cursor::new(Vec::new());
|
||||||
|
let zip = ZipWriter::new(buf);
|
||||||
|
let zip = perform_raw_copy_file(src.clone(), zip).unwrap();
|
||||||
|
let buf = zip.finish().unwrap().into_inner();
|
||||||
|
assert_eq!(buf.len(), len);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "_deflate-any")]
|
||||||
|
fn merge_archive_raw_copy_file_compressed(bench: &mut Bencher) {
|
||||||
|
let options = SimpleFileOptions::default().compression_method(zip::CompressionMethod::Deflated);
|
||||||
|
let (len, src) = generate_random_archive(NUM_ENTRIES, ENTRY_SIZE, options).unwrap();
|
||||||
|
|
||||||
|
bench.bytes = len as u64;
|
||||||
|
|
||||||
|
bench.iter(|| {
|
||||||
|
let buf = Cursor::new(Vec::new());
|
||||||
|
let zip = ZipWriter::new(buf);
|
||||||
|
let zip = perform_raw_copy_file(src.clone(), zip).unwrap();
|
||||||
|
let buf = zip.finish().unwrap().into_inner();
|
||||||
|
assert_eq!(buf.len(), len);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "_deflate-any")]
|
||||||
|
benchmark_group!(
|
||||||
|
benches,
|
||||||
|
merge_archive_stored,
|
||||||
|
merge_archive_compressed,
|
||||||
|
merge_archive_raw_copy_file_stored,
|
||||||
|
merge_archive_raw_copy_file_compressed,
|
||||||
|
);
|
||||||
|
|
||||||
|
#[cfg(not(feature = "_deflate-any"))]
|
||||||
|
benchmark_group!(
|
||||||
|
benches,
|
||||||
|
merge_archive_stored,
|
||||||
|
merge_archive_raw_copy_file_stored,
|
||||||
|
);
|
||||||
|
|
||||||
|
benchmark_main!(benches);
|
|
@ -4,13 +4,12 @@ use std::io::{Cursor, Read, Write};
|
||||||
|
|
||||||
use bencher::Bencher;
|
use bencher::Bencher;
|
||||||
use getrandom::getrandom;
|
use getrandom::getrandom;
|
||||||
use zip::{ZipArchive, ZipWriter};
|
use zip::{write::SimpleFileOptions, ZipArchive, ZipWriter};
|
||||||
|
|
||||||
fn generate_random_archive(size: usize) -> Vec<u8> {
|
fn generate_random_archive(size: usize) -> Vec<u8> {
|
||||||
let data = Vec::new();
|
let data = Vec::new();
|
||||||
let mut writer = ZipWriter::new(Cursor::new(data));
|
let mut writer = ZipWriter::new(Cursor::new(data));
|
||||||
let options =
|
let options = SimpleFileOptions::default().compression_method(zip::CompressionMethod::Stored);
|
||||||
zip::write::FileOptions::default().compression_method(zip::CompressionMethod::Stored);
|
|
||||||
|
|
||||||
writer.start_file("random.dat", options).unwrap();
|
writer.start_file("random.dat", options).unwrap();
|
||||||
let mut bytes = vec![0u8; size];
|
let mut bytes = vec![0u8; size];
|
||||||
|
|
|
@ -3,7 +3,8 @@ use bencher::{benchmark_group, benchmark_main};
|
||||||
use std::io::{Cursor, Write};
|
use std::io::{Cursor, Write};
|
||||||
|
|
||||||
use bencher::Bencher;
|
use bencher::Bencher;
|
||||||
use zip::{ZipArchive, ZipWriter};
|
use zip::write::SimpleFileOptions;
|
||||||
|
use zip::{CompressionMethod, ZipArchive, ZipWriter};
|
||||||
|
|
||||||
const FILE_COUNT: usize = 15_000;
|
const FILE_COUNT: usize = 15_000;
|
||||||
const FILE_SIZE: usize = 1024;
|
const FILE_SIZE: usize = 1024;
|
||||||
|
@ -11,8 +12,7 @@ const FILE_SIZE: usize = 1024;
|
||||||
fn generate_random_archive(count_files: usize, file_size: usize) -> Vec<u8> {
|
fn generate_random_archive(count_files: usize, file_size: usize) -> Vec<u8> {
|
||||||
let data = Vec::new();
|
let data = Vec::new();
|
||||||
let mut writer = ZipWriter::new(Cursor::new(data));
|
let mut writer = ZipWriter::new(Cursor::new(data));
|
||||||
let options =
|
let options = SimpleFileOptions::default().compression_method(CompressionMethod::Stored);
|
||||||
zip::write::FileOptions::default().compression_method(zip::CompressionMethod::Stored);
|
|
||||||
|
|
||||||
let bytes = vec![0u8; file_size];
|
let bytes = vec![0u8; file_size];
|
||||||
|
|
||||||
|
|
91
cliff.toml
Normal file
91
cliff.toml
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
# git-cliff ~ default configuration file
|
||||||
|
# https://git-cliff.org/docs/configuration
|
||||||
|
#
|
||||||
|
# Lines starting with "#" are comments.
|
||||||
|
# Configuration options are organized into tables and keys.
|
||||||
|
# See documentation for more information on available options.
|
||||||
|
|
||||||
|
[changelog]
|
||||||
|
# changelog header
|
||||||
|
header = """
|
||||||
|
# Changelog\n
|
||||||
|
All notable changes to this project will be documented in this file.\n
|
||||||
|
"""
|
||||||
|
# template for the changelog body
|
||||||
|
# https://keats.github.io/tera/docs/#introduction
|
||||||
|
body = """
|
||||||
|
{% if version %}\
|
||||||
|
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
|
||||||
|
{% else %}\
|
||||||
|
## [unreleased]
|
||||||
|
{% endif %}\
|
||||||
|
{% for group, commits in commits | group_by(attribute="group") %}
|
||||||
|
### {{ group | striptags | trim | upper_first }}
|
||||||
|
{% for commit in commits %}
|
||||||
|
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
|
||||||
|
{% if commit.breaking %}[**breaking**] {% endif %}\
|
||||||
|
{{ commit.message | upper_first }}\
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}\n
|
||||||
|
"""
|
||||||
|
# template for the changelog footer
|
||||||
|
footer = """
|
||||||
|
<!-- generated by git-cliff -->
|
||||||
|
"""
|
||||||
|
# remove the leading and trailing s
|
||||||
|
trim = true
|
||||||
|
# postprocessors
|
||||||
|
postprocessors = [
|
||||||
|
# { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
|
||||||
|
]
|
||||||
|
|
||||||
|
[git]
|
||||||
|
# parse the commits based on https://www.conventionalcommits.org
|
||||||
|
conventional_commits = true
|
||||||
|
# filter out the commits that are not conventional
|
||||||
|
filter_unconventional = true
|
||||||
|
# process each line of a commit as an individual commit
|
||||||
|
split_commits = false
|
||||||
|
# regex for preprocessing the commit messages
|
||||||
|
commit_preprocessors = [
|
||||||
|
# Replace issue numbers
|
||||||
|
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
|
||||||
|
# Check spelling of the commit with https://github.com/crate-ci/typos
|
||||||
|
# If the spelling is incorrect, it will be automatically fixed.
|
||||||
|
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
|
||||||
|
]
|
||||||
|
# regex for parsing and grouping commits
|
||||||
|
commit_parsers = [
|
||||||
|
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
|
||||||
|
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
|
||||||
|
{ message = "^doc", skip = true },
|
||||||
|
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
|
||||||
|
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
|
||||||
|
{ message = "^style", skip = true },
|
||||||
|
{ message = "^test", skip = true },
|
||||||
|
{ message = "^build", skip = true },
|
||||||
|
{ message = "^ci", skip = true },
|
||||||
|
{ message = "^chore\\(release\\)", skip = true },
|
||||||
|
{ message = "^chore\\(deps.*\\)", skip = true },
|
||||||
|
{ message = "^chore\\(pr\\)", skip = true },
|
||||||
|
{ message = "^chore\\(pull\\)", skip = true },
|
||||||
|
{ message = "^chore", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
|
||||||
|
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
|
||||||
|
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
|
||||||
|
]
|
||||||
|
# protect breaking changes from being skipped due to matching a skipping commit_parser
|
||||||
|
protect_breaking_commits = true
|
||||||
|
# filter out the commits that are not matched by commit parsers
|
||||||
|
filter_commits = false
|
||||||
|
# regex for matching git tags
|
||||||
|
# tag_pattern = "v[0-9].*"
|
||||||
|
# regex for skipping tags
|
||||||
|
# skip_tags = ""
|
||||||
|
# regex for ignoring tags
|
||||||
|
# ignore_tags = ""
|
||||||
|
# sort the tags topologically
|
||||||
|
topo_order = false
|
||||||
|
# sort the commits inside sections by oldest/newest order
|
||||||
|
sort_commits = "oldest"
|
||||||
|
# limit the number of commits included in the changelog.
|
||||||
|
# limit_commits = 42
|
63
examples/append.rs
Normal file
63
examples/append.rs
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
use std::{
|
||||||
|
fs::{File, OpenOptions},
|
||||||
|
path::{Path, PathBuf},
|
||||||
|
str::FromStr,
|
||||||
|
};
|
||||||
|
use zip::write::SimpleFileOptions;
|
||||||
|
|
||||||
|
fn gather_files<'a, T: Into<&'a Path>>(path: T, files: &mut Vec<PathBuf>) {
|
||||||
|
let path: &Path = path.into();
|
||||||
|
|
||||||
|
for entry in path.read_dir().unwrap() {
|
||||||
|
match entry {
|
||||||
|
Ok(e) => {
|
||||||
|
if e.path().is_dir() {
|
||||||
|
gather_files(e.path().as_ref(), files);
|
||||||
|
} else if e.path().is_file() {
|
||||||
|
files.push(e.path());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(_) => todo!(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn real_main() -> i32 {
|
||||||
|
let args: Vec<_> = std::env::args().collect();
|
||||||
|
if args.len() < 3 {
|
||||||
|
println!("Usage: {} <existing archive> <folder_to_append>", args[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
let existing_archive_path = &*args[1];
|
||||||
|
let append_dir_path = &*args[2];
|
||||||
|
let archive = PathBuf::from_str(existing_archive_path).unwrap();
|
||||||
|
let to_append = PathBuf::from_str(append_dir_path).unwrap();
|
||||||
|
|
||||||
|
let existing_zip = OpenOptions::new()
|
||||||
|
.read(true)
|
||||||
|
.write(true)
|
||||||
|
.open(archive)
|
||||||
|
.unwrap();
|
||||||
|
let mut append_zip = zip::ZipWriter::new_append(existing_zip).unwrap();
|
||||||
|
|
||||||
|
let mut files: Vec<PathBuf> = vec![];
|
||||||
|
gather_files(to_append.as_ref(), &mut files);
|
||||||
|
|
||||||
|
for file in files {
|
||||||
|
append_zip
|
||||||
|
.start_file(file.to_string_lossy(), SimpleFileOptions::default())
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let mut f = File::open(file).unwrap();
|
||||||
|
let _ = std::io::copy(&mut f, &mut append_zip);
|
||||||
|
}
|
||||||
|
|
||||||
|
append_zip.finish().unwrap();
|
||||||
|
|
||||||
|
0
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
std::process::exit(real_main());
|
||||||
|
}
|
|
@ -30,7 +30,7 @@ fn real_main() -> i32 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*file.name()).ends_with('/') {
|
if file.is_dir() {
|
||||||
println!("File {} extracted to \"{}\"", i, outpath.display());
|
println!("File {} extracted to \"{}\"", i, outpath.display());
|
||||||
fs::create_dir_all(&outpath).unwrap();
|
fs::create_dir_all(&outpath).unwrap();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -34,7 +34,7 @@ fn real_main() -> i32 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*file.name()).ends_with('/') {
|
if file.is_dir() {
|
||||||
println!(
|
println!(
|
||||||
"Entry {} is a directory with name \"{}\"",
|
"Entry {} is a directory with name \"{}\"",
|
||||||
i,
|
i,
|
||||||
|
|
43
examples/write-large-file.rs
Normal file
43
examples/write-large-file.rs
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
//! Write a huge file with lots of zeros, that should compress perfectly.
|
||||||
|
|
||||||
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
if !cfg!(feature = "_deflate-any") {
|
||||||
|
return Err("Please enable one of the deflate features".into());
|
||||||
|
}
|
||||||
|
let args: Vec<_> = std::env::args().collect();
|
||||||
|
if args.len() < 2 {
|
||||||
|
return Err(format!("Usage: {} <filename>", args[0]).into());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "_deflate-any")]
|
||||||
|
{
|
||||||
|
let filename = &*args[1];
|
||||||
|
doit(filename)?;
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "_deflate-any")]
|
||||||
|
fn doit(filename: &str) -> zip::result::ZipResult<()> {
|
||||||
|
use std::io::Write;
|
||||||
|
|
||||||
|
use zip::write::SimpleFileOptions;
|
||||||
|
|
||||||
|
let file = std::fs::File::create(filename)?;
|
||||||
|
let mut zip = zip::ZipWriter::new(file);
|
||||||
|
|
||||||
|
let options = SimpleFileOptions::default()
|
||||||
|
.compression_method(zip::CompressionMethod::Deflated)
|
||||||
|
// files over u32::MAX require this flag set.
|
||||||
|
.large_file(true)
|
||||||
|
.unix_permissions(0o755);
|
||||||
|
zip.start_file("huge-file-of-zeroes", options)?;
|
||||||
|
let content: Vec<_> = std::iter::repeat(0_u8).take(65 * 1024).collect();
|
||||||
|
let mut bytes_written = 0_u64;
|
||||||
|
while bytes_written < u32::MAX as u64 {
|
||||||
|
zip.write_all(&content)?;
|
||||||
|
bytes_written += content.len() as u64;
|
||||||
|
}
|
||||||
|
zip.finish()?;
|
||||||
|
Ok(())
|
||||||
|
}
|
|
@ -1,30 +1,45 @@
|
||||||
|
#![allow(unused_variables)]
|
||||||
|
#![allow(dead_code)]
|
||||||
|
use anyhow::Context;
|
||||||
|
use clap::{Parser, ValueEnum};
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
use std::io::{Seek, Write};
|
use zip::{result::ZipError, write::SimpleFileOptions};
|
||||||
use std::iter::Iterator;
|
|
||||||
use zip::result::ZipError;
|
|
||||||
use zip::write::FileOptions;
|
|
||||||
|
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::path::Path;
|
use std::path::{Path, PathBuf};
|
||||||
use walkdir::{DirEntry, WalkDir};
|
use walkdir::{DirEntry, WalkDir};
|
||||||
|
|
||||||
|
#[derive(Parser)]
|
||||||
|
#[command(about, long_about = None)]
|
||||||
|
struct Args {
|
||||||
|
// Source directory
|
||||||
|
source: PathBuf,
|
||||||
|
// Destination zipfile
|
||||||
|
destination: PathBuf,
|
||||||
|
// Compression method
|
||||||
|
#[arg(value_enum)]
|
||||||
|
compression_method: CompressionMethod,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, ValueEnum)]
|
||||||
|
enum CompressionMethod {
|
||||||
|
Stored,
|
||||||
|
Deflated,
|
||||||
|
DeflatedMiniz,
|
||||||
|
DeflatedZlib,
|
||||||
|
Bzip2,
|
||||||
|
Zstd,
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
std::process::exit(real_main());
|
std::process::exit(real_main());
|
||||||
}
|
}
|
||||||
|
|
||||||
const METHOD_STORED: Option<zip::CompressionMethod> = Some(zip::CompressionMethod::Stored);
|
const METHOD_STORED: Option<zip::CompressionMethod> = Some(zip::CompressionMethod::Stored);
|
||||||
|
|
||||||
#[cfg(any(
|
#[cfg(feature = "_deflate-any")]
|
||||||
feature = "deflate",
|
|
||||||
feature = "deflate-miniz",
|
|
||||||
feature = "deflate-zlib"
|
|
||||||
))]
|
|
||||||
const METHOD_DEFLATED: Option<zip::CompressionMethod> = Some(zip::CompressionMethod::Deflated);
|
const METHOD_DEFLATED: Option<zip::CompressionMethod> = Some(zip::CompressionMethod::Deflated);
|
||||||
#[cfg(not(any(
|
#[cfg(not(feature = "_deflate-any"))]
|
||||||
feature = "deflate",
|
|
||||||
feature = "deflate-miniz",
|
|
||||||
feature = "deflate-zlib"
|
|
||||||
)))]
|
|
||||||
const METHOD_DEFLATED: Option<zip::CompressionMethod> = None;
|
const METHOD_DEFLATED: Option<zip::CompressionMethod> = None;
|
||||||
|
|
||||||
#[cfg(feature = "bzip2")]
|
#[cfg(feature = "bzip2")]
|
||||||
|
@ -38,25 +53,60 @@ const METHOD_ZSTD: Option<zip::CompressionMethod> = Some(zip::CompressionMethod:
|
||||||
const METHOD_ZSTD: Option<zip::CompressionMethod> = None;
|
const METHOD_ZSTD: Option<zip::CompressionMethod> = None;
|
||||||
|
|
||||||
fn real_main() -> i32 {
|
fn real_main() -> i32 {
|
||||||
let args: Vec<_> = std::env::args().collect();
|
let args = Args::parse();
|
||||||
if args.len() < 3 {
|
let src_dir = &args.source;
|
||||||
println!(
|
let dst_file = &args.destination;
|
||||||
"Usage: {} <source_directory> <destination_zipfile>",
|
let method = match args.compression_method {
|
||||||
args[0]
|
CompressionMethod::Stored => zip::CompressionMethod::Stored,
|
||||||
);
|
CompressionMethod::Deflated => {
|
||||||
return 1;
|
#[cfg(not(feature = "deflate"))]
|
||||||
}
|
{
|
||||||
|
println!("The `deflate` feature is not enabled");
|
||||||
let src_dir = &*args[1];
|
return 1;
|
||||||
let dst_file = &*args[2];
|
}
|
||||||
for &method in [METHOD_STORED, METHOD_DEFLATED, METHOD_BZIP2, METHOD_ZSTD].iter() {
|
#[cfg(feature = "deflate")]
|
||||||
if method.is_none() {
|
zip::CompressionMethod::Deflated
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
match doit(src_dir, dst_file, method.unwrap()) {
|
CompressionMethod::DeflatedMiniz => {
|
||||||
Ok(_) => println!("done: {src_dir} written to {dst_file}"),
|
#[cfg(not(feature = "deflate-miniz"))]
|
||||||
Err(e) => println!("Error: {e:?}"),
|
{
|
||||||
|
println!("The `deflate-miniz` feature is not enabled");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#[cfg(feature = "deflate-miniz")]
|
||||||
|
zip::CompressionMethod::Deflated
|
||||||
}
|
}
|
||||||
|
CompressionMethod::DeflatedZlib => {
|
||||||
|
#[cfg(not(feature = "deflate-zlib"))]
|
||||||
|
{
|
||||||
|
println!("The `deflate-zlib` feature is not enabled");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#[cfg(feature = "deflate-zlib")]
|
||||||
|
zip::CompressionMethod::Deflated
|
||||||
|
}
|
||||||
|
CompressionMethod::Bzip2 => {
|
||||||
|
#[cfg(not(feature = "bzip2"))]
|
||||||
|
{
|
||||||
|
println!("The `bzip2` feature is not enabled");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#[cfg(feature = "bzip2")]
|
||||||
|
zip::CompressionMethod::Bzip2
|
||||||
|
}
|
||||||
|
CompressionMethod::Zstd => {
|
||||||
|
#[cfg(not(feature = "zstd"))]
|
||||||
|
{
|
||||||
|
println!("The `zstd` feature is not enabled");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#[cfg(feature = "zstd")]
|
||||||
|
zip::CompressionMethod::Zstd
|
||||||
|
}
|
||||||
|
};
|
||||||
|
match doit(src_dir, dst_file, method) {
|
||||||
|
Ok(_) => println!("done: {:?} written to {:?}", src_dir, dst_file),
|
||||||
|
Err(e) => eprintln!("Error: {e:?}"),
|
||||||
}
|
}
|
||||||
|
|
||||||
0
|
0
|
||||||
|
@ -64,29 +114,33 @@ fn real_main() -> i32 {
|
||||||
|
|
||||||
fn zip_dir<T>(
|
fn zip_dir<T>(
|
||||||
it: &mut dyn Iterator<Item = DirEntry>,
|
it: &mut dyn Iterator<Item = DirEntry>,
|
||||||
prefix: &str,
|
prefix: &Path,
|
||||||
writer: T,
|
writer: T,
|
||||||
method: zip::CompressionMethod,
|
method: zip::CompressionMethod,
|
||||||
) -> zip::result::ZipResult<()>
|
) -> anyhow::Result<()>
|
||||||
where
|
where
|
||||||
T: Write + Seek,
|
T: Write + Seek,
|
||||||
{
|
{
|
||||||
let mut zip = zip::ZipWriter::new(writer);
|
let mut zip = zip::ZipWriter::new(writer);
|
||||||
let options = FileOptions::default()
|
let options = SimpleFileOptions::default()
|
||||||
.compression_method(method)
|
.compression_method(method)
|
||||||
.unix_permissions(0o755);
|
.unix_permissions(0o755);
|
||||||
|
|
||||||
|
let prefix = Path::new(prefix);
|
||||||
let mut buffer = Vec::new();
|
let mut buffer = Vec::new();
|
||||||
for entry in it {
|
for entry in it {
|
||||||
let path = entry.path();
|
let path = entry.path();
|
||||||
let name = path.strip_prefix(Path::new(prefix)).unwrap();
|
let name = path.strip_prefix(prefix).unwrap();
|
||||||
|
let path_as_string = name
|
||||||
|
.to_str()
|
||||||
|
.map(str::to_owned)
|
||||||
|
.with_context(|| format!("{name:?} Is a Non UTF-8 Path"))?;
|
||||||
|
|
||||||
// Write file or directory explicitly
|
// Write file or directory explicitly
|
||||||
// Some unzip tools unzip files with directory paths correctly, some do not!
|
// Some unzip tools unzip files with directory paths correctly, some do not!
|
||||||
if path.is_file() {
|
if path.is_file() {
|
||||||
println!("adding file {path:?} as {name:?} ...");
|
println!("adding file {path:?} as {name:?} ...");
|
||||||
#[allow(deprecated)]
|
zip.start_file(path_as_string, options)?;
|
||||||
zip.start_file_from_path(name, options)?;
|
|
||||||
let mut f = File::open(path)?;
|
let mut f = File::open(path)?;
|
||||||
|
|
||||||
f.read_to_end(&mut buffer)?;
|
f.read_to_end(&mut buffer)?;
|
||||||
|
@ -95,22 +149,17 @@ where
|
||||||
} else if !name.as_os_str().is_empty() {
|
} else if !name.as_os_str().is_empty() {
|
||||||
// Only if not root! Avoids path spec / warning
|
// Only if not root! Avoids path spec / warning
|
||||||
// and mapname conversion failed error on unzip
|
// and mapname conversion failed error on unzip
|
||||||
println!("adding dir {path:?} as {name:?} ...");
|
println!("adding dir {path_as_string:?} as {name:?} ...");
|
||||||
#[allow(deprecated)]
|
zip.add_directory(path_as_string, options)?;
|
||||||
zip.add_directory_from_path(name, options)?;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
zip.finish()?;
|
zip.finish()?;
|
||||||
Result::Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn doit(
|
fn doit(src_dir: &Path, dst_file: &Path, method: zip::CompressionMethod) -> anyhow::Result<()> {
|
||||||
src_dir: &str,
|
|
||||||
dst_file: &str,
|
|
||||||
method: zip::CompressionMethod,
|
|
||||||
) -> zip::result::ZipResult<()> {
|
|
||||||
if !Path::new(src_dir).is_dir() {
|
if !Path::new(src_dir).is_dir() {
|
||||||
return Err(ZipError::FileNotFound);
|
return Err(ZipError::FileNotFound.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
let path = Path::new(dst_file);
|
let path = Path::new(dst_file);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
use zip::write::FileOptions;
|
use zip::write::SimpleFileOptions;
|
||||||
|
#[cfg(feature = "aes-crypto")]
|
||||||
|
use zip::{AesMode, CompressionMethod};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
std::process::exit(real_main());
|
std::process::exit(real_main());
|
||||||
|
@ -27,17 +29,35 @@ fn doit(filename: &str) -> zip::result::ZipResult<()> {
|
||||||
|
|
||||||
let mut zip = zip::ZipWriter::new(file);
|
let mut zip = zip::ZipWriter::new(file);
|
||||||
|
|
||||||
zip.add_directory("test/", Default::default())?;
|
zip.add_directory("test/", SimpleFileOptions::default())?;
|
||||||
|
|
||||||
let options = FileOptions::default()
|
let options = SimpleFileOptions::default()
|
||||||
.compression_method(zip::CompressionMethod::Stored)
|
.compression_method(zip::CompressionMethod::Stored)
|
||||||
.unix_permissions(0o755);
|
.unix_permissions(0o755);
|
||||||
zip.start_file("test/☃.txt", options)?;
|
zip.start_file("test/☃.txt", options)?;
|
||||||
zip.write_all(b"Hello, World!\n")?;
|
zip.write_all(b"Hello, World!\n")?;
|
||||||
|
|
||||||
zip.start_file("test/lorem_ipsum.txt", Default::default())?;
|
zip.start_file("test/lorem_ipsum.txt", options)?;
|
||||||
zip.write_all(LOREM_IPSUM)?;
|
zip.write_all(LOREM_IPSUM)?;
|
||||||
|
|
||||||
|
#[cfg(feature = "aes-crypto")]
|
||||||
|
{
|
||||||
|
zip.start_file(
|
||||||
|
"test/lorem_ipsum.aes.txt",
|
||||||
|
options
|
||||||
|
.compression_method(CompressionMethod::Zstd)
|
||||||
|
.with_aes_encryption(AesMode::Aes256, "password"),
|
||||||
|
)?;
|
||||||
|
zip.write_all(LOREM_IPSUM)?;
|
||||||
|
|
||||||
|
// This should use AE-1 due to the short file length.
|
||||||
|
zip.start_file(
|
||||||
|
"test/short.aes.txt",
|
||||||
|
options.with_aes_encryption(AesMode::Aes256, "password"),
|
||||||
|
)?;
|
||||||
|
zip.write_all(b"short text\n")?;
|
||||||
|
}
|
||||||
|
|
||||||
zip.finish()?;
|
zip.finish()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
1
fuzz/.gitignore
vendored
1
fuzz/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
||||||
target
|
target
|
||||||
corpus
|
|
||||||
artifacts
|
artifacts
|
||||||
|
|
|
@ -10,9 +10,16 @@ cargo-fuzz = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libfuzzer-sys = "0.4"
|
libfuzzer-sys = "0.4"
|
||||||
|
arbitrary = { version = "1.3.0", features = ["derive"] }
|
||||||
|
replace_with = "0.1.7"
|
||||||
|
|
||||||
[dependencies.zip]
|
[dependencies.zip]
|
||||||
path = ".."
|
path = ".."
|
||||||
|
default-features = false
|
||||||
|
|
||||||
|
[features]
|
||||||
|
zip_defaults = ["zip/default"]
|
||||||
|
default = ["zip_defaults"]
|
||||||
|
|
||||||
# Prevent this from interfering with workspaces
|
# Prevent this from interfering with workspaces
|
||||||
[workspace]
|
[workspace]
|
||||||
|
@ -23,3 +30,9 @@ name = "fuzz_read"
|
||||||
path = "fuzz_targets/fuzz_read.rs"
|
path = "fuzz_targets/fuzz_read.rs"
|
||||||
test = false
|
test = false
|
||||||
doc = false
|
doc = false
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "fuzz_write"
|
||||||
|
path = "fuzz_targets/fuzz_write.rs"
|
||||||
|
test = false
|
||||||
|
doc = false
|
||||||
|
|
BIN
fuzz/corpus/fuzz_read/0085adc5ffd2897ecdf0941cd02ea7b58c667b8b
Normal file
BIN
fuzz/corpus/fuzz_read/0085adc5ffd2897ecdf0941cd02ea7b58c667b8b
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/009557a47cc90a54f646a2d5bc0fbea362979ee7
Normal file
BIN
fuzz/corpus/fuzz_read/009557a47cc90a54f646a2d5bc0fbea362979ee7
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/00f6cb3de1e7c80dd6642603a1fc6c4f08769f4f
Normal file
BIN
fuzz/corpus/fuzz_read/00f6cb3de1e7c80dd6642603a1fc6c4f08769f4f
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0199fe39523f6562f114656ccf51fecd79a02147
Normal file
BIN
fuzz/corpus/fuzz_read/0199fe39523f6562f114656ccf51fecd79a02147
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/01e829113cf8d6c35b3446758655c9238b8d363a
Normal file
BIN
fuzz/corpus/fuzz_read/01e829113cf8d6c35b3446758655c9238b8d363a
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/021fade46ec68d61b9fefb5b0e62971ab2051396
Normal file
BIN
fuzz/corpus/fuzz_read/021fade46ec68d61b9fefb5b0e62971ab2051396
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/021fcf1bcc75cc7e2291b246e870dff08471d80d
Normal file
BIN
fuzz/corpus/fuzz_read/021fcf1bcc75cc7e2291b246e870dff08471d80d
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0248d53796e8d01ab3d2a12bfa9bc08045c6bbce
Normal file
BIN
fuzz/corpus/fuzz_read/0248d53796e8d01ab3d2a12bfa9bc08045c6bbce
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/02eae92f4068710a49fb2db063ba01f6de8f7a66
Normal file
BIN
fuzz/corpus/fuzz_read/02eae92f4068710a49fb2db063ba01f6de8f7a66
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/02f87bed6f304a114ac8d27c1c383f0cd48a0e31
Normal file
BIN
fuzz/corpus/fuzz_read/02f87bed6f304a114ac8d27c1c383f0cd48a0e31
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/035bdddf034ff981a3172e3a7139876a4007491b
Normal file
BIN
fuzz/corpus/fuzz_read/035bdddf034ff981a3172e3a7139876a4007491b
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/036555366a1199ccd31d9858267cdd69777b3c10
Normal file
BIN
fuzz/corpus/fuzz_read/036555366a1199ccd31d9858267cdd69777b3c10
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/03821a96addcc8927afd28ce0e8ffca4464b800f
Normal file
BIN
fuzz/corpus/fuzz_read/03821a96addcc8927afd28ce0e8ffca4464b800f
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/03e5a4772a2e21d662c75a43b6e0d6cc796f02d1
Normal file
BIN
fuzz/corpus/fuzz_read/03e5a4772a2e21d662c75a43b6e0d6cc796f02d1
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/03f6800edcca5ca07224fa3cfa9749338f54d628
Normal file
BIN
fuzz/corpus/fuzz_read/03f6800edcca5ca07224fa3cfa9749338f54d628
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0433cce8febc001cf18f32ad10f592022d743148
Normal file
BIN
fuzz/corpus/fuzz_read/0433cce8febc001cf18f32ad10f592022d743148
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/044219e9e707d8a8fd882478fc50338aeddd9dfb
Normal file
BIN
fuzz/corpus/fuzz_read/044219e9e707d8a8fd882478fc50338aeddd9dfb
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/044ce0ef54cd42e605fb199ce89b409b24dcca3b
Normal file
BIN
fuzz/corpus/fuzz_read/044ce0ef54cd42e605fb199ce89b409b24dcca3b
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/046498b51fc751bd482cd0065bcaaefd7e05331e
Normal file
BIN
fuzz/corpus/fuzz_read/046498b51fc751bd482cd0065bcaaefd7e05331e
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/047598019d26761df63785f5c900b8d0f69e3f98
Normal file
BIN
fuzz/corpus/fuzz_read/047598019d26761df63785f5c900b8d0f69e3f98
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/04e9e495c7cd7debe9dcf43a2787423ead4b5178
Normal file
BIN
fuzz/corpus/fuzz_read/04e9e495c7cd7debe9dcf43a2787423ead4b5178
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/05cbfb3a765043677af1c3069109c976c65d3c5b
Normal file
BIN
fuzz/corpus/fuzz_read/05cbfb3a765043677af1c3069109c976c65d3c5b
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/05d7d14823d27067a4c4113cd99c40e4843806d4
Normal file
BIN
fuzz/corpus/fuzz_read/05d7d14823d27067a4c4113cd99c40e4843806d4
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0631765a3fc89719720a0aec98e8b89bf723ac5e
Normal file
BIN
fuzz/corpus/fuzz_read/0631765a3fc89719720a0aec98e8b89bf723ac5e
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/064806139cbf94e7adb305c9929dfb25fc67ef00
Normal file
BIN
fuzz/corpus/fuzz_read/064806139cbf94e7adb305c9929dfb25fc67ef00
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0683fbaabfdee19cac147df309151c2ac0b86c5f
Normal file
BIN
fuzz/corpus/fuzz_read/0683fbaabfdee19cac147df309151c2ac0b86c5f
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/06b7c85e278be459348b5f6df8c1cb1df0784e49
Normal file
BIN
fuzz/corpus/fuzz_read/06b7c85e278be459348b5f6df8c1cb1df0784e49
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/06d1dbbeeeb1521ac2dafd90e91b3e54c4aa71de
Normal file
BIN
fuzz/corpus/fuzz_read/06d1dbbeeeb1521ac2dafd90e91b3e54c4aa71de
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/06f49ae983f74345dab96953ffb6a7eff3aa5687
Normal file
BIN
fuzz/corpus/fuzz_read/06f49ae983f74345dab96953ffb6a7eff3aa5687
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/075b55ec8105bfc042d7cf996352547db3d6b375
Normal file
BIN
fuzz/corpus/fuzz_read/075b55ec8105bfc042d7cf996352547db3d6b375
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/08012138fffc7bedb567292b5d6975c287afab6d
Normal file
BIN
fuzz/corpus/fuzz_read/08012138fffc7bedb567292b5d6975c287afab6d
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/08472cc4b3e4843df80e8354b74d9883a60eae89
Normal file
BIN
fuzz/corpus/fuzz_read/08472cc4b3e4843df80e8354b74d9883a60eae89
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0853083d49e1377b679998291ded23c010b10f79
Normal file
BIN
fuzz/corpus/fuzz_read/0853083d49e1377b679998291ded23c010b10f79
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/09549bee4c50e9f2bd8724264b034ee057c2f266
Normal file
BIN
fuzz/corpus/fuzz_read/09549bee4c50e9f2bd8724264b034ee057c2f266
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0972523dff0bf0eacd7850d310ecc7a7fdb95384
Normal file
BIN
fuzz/corpus/fuzz_read/0972523dff0bf0eacd7850d310ecc7a7fdb95384
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0978ccc5a237e1fce8f5f87f7f8f9a788149b6bb
Normal file
BIN
fuzz/corpus/fuzz_read/0978ccc5a237e1fce8f5f87f7f8f9a788149b6bb
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/09846e91ce5425c4fe8ffd0a831857979d9db679
Normal file
BIN
fuzz/corpus/fuzz_read/09846e91ce5425c4fe8ffd0a831857979d9db679
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/09d0068fc86501fa974486fe6cd36967ad4b9d3e
Normal file
BIN
fuzz/corpus/fuzz_read/09d0068fc86501fa974486fe6cd36967ad4b9d3e
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/09fd72dd11b982d2118931392d8c1f4caf2df027
Normal file
BIN
fuzz/corpus/fuzz_read/09fd72dd11b982d2118931392d8c1f4caf2df027
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0a173ae384aa3e1fb63b02b57e9f7ac0845939dd
Normal file
BIN
fuzz/corpus/fuzz_read/0a173ae384aa3e1fb63b02b57e9f7ac0845939dd
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0a25c93b571f1a29461fddefecf0777ed77b4aa1
Normal file
BIN
fuzz/corpus/fuzz_read/0a25c93b571f1a29461fddefecf0777ed77b4aa1
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0a3c02649efbb37707eb65dbb83f2d406743f7b4
Normal file
BIN
fuzz/corpus/fuzz_read/0a3c02649efbb37707eb65dbb83f2d406743f7b4
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0aa6eca2fc868cb344a8d53853f42f7ede579943
Normal file
BIN
fuzz/corpus/fuzz_read/0aa6eca2fc868cb344a8d53853f42f7ede579943
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0b22d34dc3549dc03033f331fba72536214a64a8
Normal file
BIN
fuzz/corpus/fuzz_read/0b22d34dc3549dc03033f331fba72536214a64a8
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0b567e6d4e5d7309363fc010163fa5c4e1601f8b
Normal file
BIN
fuzz/corpus/fuzz_read/0b567e6d4e5d7309363fc010163fa5c4e1601f8b
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0b56bdf9c3edf634eea90b915fb7130249d38690
Normal file
BIN
fuzz/corpus/fuzz_read/0b56bdf9c3edf634eea90b915fb7130249d38690
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0b5e97c2a679ded65e78983437288769ebffe980
Normal file
BIN
fuzz/corpus/fuzz_read/0b5e97c2a679ded65e78983437288769ebffe980
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0be58b6f96ffb8038b18908db3453ab200726b3f
Normal file
BIN
fuzz/corpus/fuzz_read/0be58b6f96ffb8038b18908db3453ab200726b3f
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0c1745136698832abe5280679b54093013e946b1
Normal file
BIN
fuzz/corpus/fuzz_read/0c1745136698832abe5280679b54093013e946b1
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0c6d0e7a5dc104a4b3fba767515cf6dcca1f2f54
Normal file
BIN
fuzz/corpus/fuzz_read/0c6d0e7a5dc104a4b3fba767515cf6dcca1f2f54
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0cc677435d79d05b4400a1a1a961d30d7a12c9e3
Normal file
BIN
fuzz/corpus/fuzz_read/0cc677435d79d05b4400a1a1a961d30d7a12c9e3
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0d1144b245671ffc3aac283947bb3b135e74bb1e
Normal file
BIN
fuzz/corpus/fuzz_read/0d1144b245671ffc3aac283947bb3b135e74bb1e
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0d277083394331b09af009959e659bbb80a1552e
Normal file
BIN
fuzz/corpus/fuzz_read/0d277083394331b09af009959e659bbb80a1552e
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0d2a2122da9090ccfb44deddb16b8826e40e17df
Normal file
BIN
fuzz/corpus/fuzz_read/0d2a2122da9090ccfb44deddb16b8826e40e17df
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0d58bd0f63bc8deea66be9d0b8efc84ea3feba0b
Normal file
BIN
fuzz/corpus/fuzz_read/0d58bd0f63bc8deea66be9d0b8efc84ea3feba0b
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0d682f4cefeb60f0edc832eca02af9874bd7ada9
Normal file
BIN
fuzz/corpus/fuzz_read/0d682f4cefeb60f0edc832eca02af9874bd7ada9
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0da84e8b65408bd75d9a83137d89ccbd2ff817f3
Normal file
BIN
fuzz/corpus/fuzz_read/0da84e8b65408bd75d9a83137d89ccbd2ff817f3
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0db6baffcd3b4f71cf2a637a137e283033d81f6a
Normal file
BIN
fuzz/corpus/fuzz_read/0db6baffcd3b4f71cf2a637a137e283033d81f6a
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0dc2f5f855f7cf5397b555aac8257d1140d96093
Normal file
BIN
fuzz/corpus/fuzz_read/0dc2f5f855f7cf5397b555aac8257d1140d96093
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0de495a9f807d70841b15bc2bc4a19ad3f606aaa
Normal file
BIN
fuzz/corpus/fuzz_read/0de495a9f807d70841b15bc2bc4a19ad3f606aaa
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0e989644e220a3cb6d457c78e1097063878b75a9
Normal file
BIN
fuzz/corpus/fuzz_read/0e989644e220a3cb6d457c78e1097063878b75a9
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0ef85242ce142fc7f182fd12a7c9c9d0147dbc82
Normal file
BIN
fuzz/corpus/fuzz_read/0ef85242ce142fc7f182fd12a7c9c9d0147dbc82
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0f508d29a37f0e07b73ec88d84b45b475f186e90
Normal file
BIN
fuzz/corpus/fuzz_read/0f508d29a37f0e07b73ec88d84b45b475f186e90
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0ff1ffcc2f73d5fe3ab543e0eeedab6b2157f7d1
Normal file
BIN
fuzz/corpus/fuzz_read/0ff1ffcc2f73d5fe3ab543e0eeedab6b2157f7d1
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0ff388b04b1cebf5429fc2b2b5161f96343680c0
Normal file
BIN
fuzz/corpus/fuzz_read/0ff388b04b1cebf5429fc2b2b5161f96343680c0
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/0ff663ec322f9ed36b8c6463abdf1af50eeb17ed
Normal file
BIN
fuzz/corpus/fuzz_read/0ff663ec322f9ed36b8c6463abdf1af50eeb17ed
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/11697aab68c77c945bd2a96dcc3f4677617b7183
Normal file
BIN
fuzz/corpus/fuzz_read/11697aab68c77c945bd2a96dcc3f4677617b7183
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/11b90b1352be2e9fbd9c2ed575ef9c6318169e1b
Normal file
BIN
fuzz/corpus/fuzz_read/11b90b1352be2e9fbd9c2ed575ef9c6318169e1b
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/120ce171809fadcdde6a6a1e88d45d30e9c0d5fe
Normal file
BIN
fuzz/corpus/fuzz_read/120ce171809fadcdde6a6a1e88d45d30e9c0d5fe
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/122230c2da8e2f990382e86029ca7db3d74bedaf
Normal file
BIN
fuzz/corpus/fuzz_read/122230c2da8e2f990382e86029ca7db3d74bedaf
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/126bb06edc69cacb8f4ad7e2ad15b2f74768a26d
Normal file
BIN
fuzz/corpus/fuzz_read/126bb06edc69cacb8f4ad7e2ad15b2f74768a26d
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/12f40c129a09e4615b45d5caa8277152d09c308d
Normal file
BIN
fuzz/corpus/fuzz_read/12f40c129a09e4615b45d5caa8277152d09c308d
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/130ac25045a553e2bc9f3fee20f7b33286a63ce4
Normal file
BIN
fuzz/corpus/fuzz_read/130ac25045a553e2bc9f3fee20f7b33286a63ce4
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/13aa3f16d34394d8e00db20be962f5103a1817b8
Normal file
BIN
fuzz/corpus/fuzz_read/13aa3f16d34394d8e00db20be962f5103a1817b8
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/13cc7e70a9e08f09ce2fda41d6e0f9d642c59cc0
Normal file
BIN
fuzz/corpus/fuzz_read/13cc7e70a9e08f09ce2fda41d6e0f9d642c59cc0
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/13d3abd44bc292c29dd47704c95d0aaea48dfafd
Normal file
BIN
fuzz/corpus/fuzz_read/13d3abd44bc292c29dd47704c95d0aaea48dfafd
Normal file
Binary file not shown.
BIN
fuzz/corpus/fuzz_read/14d7adc4fc63df47e5de468d17c814312615f5ca
Normal file
BIN
fuzz/corpus/fuzz_read/14d7adc4fc63df47e5de468d17c814312615f5ca
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue