diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e3a974..b965692 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,4 +58,19 @@ jobs: path: './pages/dist/' - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v2 \ No newline at end of file + uses: actions/deploy-pages@v2 + fuzz: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - name: Install cargo-fuzz + uses: baptiste0928/cargo-install@v3 + with: + crate: cargo-fuzz + locked: false + - name: Fuzz + run: RUST_BACKTRACE=1 cargo fuzz run fuzz -- -max_total_time=900 \ No newline at end of file diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index c2924c3..68fb72a 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -13,7 +13,7 @@ libfuzzer-sys = "0.4" [dependencies.rustrict] path = ".." -features = ["width"] +features = ["pii", "width"] # Prevent this from interfering with workspaces [workspace] diff --git a/fuzz/fuzz_targets/fuzz.rs b/fuzz/fuzz_targets/fuzz.rs index 1f0d364..95bf5b8 100644 --- a/fuzz/fuzz_targets/fuzz.rs +++ b/fuzz/fuzz_targets/fuzz.rs @@ -10,6 +10,7 @@ fuzz_target!(|data: &[u8]| { if let Ok(text) = std::str::from_utf8(input) { let _ = rustrict::width_str(text); let _ = rustrict::trim_to_width(text, 10); + let _ = rustrict::censor_and_analyze_pii(text); let (_censored, _analysis) = Censor::from_str(text) .with_ignore_self_censoring(flag(flags, 0))