Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/fuzzing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
fuzz/corpus/${{ matrix.test-target.name }}
- name: Run ${{ matrix.test-target.name }} for XX seconds
shell: bash
continue-on-error: ${{ !matrix.test-target.name.should_pass }}
continue-on-error: ${{ !matrix.test-target.should_pass }}
run: |
cargo fuzz run ${{ matrix.test-target.name }} -- -max_total_time=${{ env.RUN_FOR }} -detect_leaks=0
- name: Save Corpus Cache
Expand Down
4 changes: 2 additions & 2 deletions fuzz/fuzz_targets/fuzz_cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extern crate libfuzzer_sys;
use diffutilslib::cmp::{self, Cmp};

use std::ffi::OsString;
use std::fs::File;
use std::fs::{self, File};
use std::io::Write;

fn os(s: &str) -> OsString {
Expand All @@ -18,7 +18,7 @@ fuzz_target!(|x: (Vec<u8>, Vec<u8>)| {
.peekable();

let (from, to) = x;

fs::create_dir_all("target").unwrap();
File::create("target/fuzz.cmp.a")
.unwrap()
.write_all(&from)
Expand Down
3 changes: 3 additions & 0 deletions fuzz/fuzz_targets/fuzz_cmp_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ fn os(s: &str) -> OsString {
}

fuzz_target!(|x: Vec<OsString>| -> Corpus {
if x.iter().any(|a| a == "--help") {
return Corpus::Reject;
}
if x.len() > 6 {
// Make sure we try to parse an option when we get longer args. x[0] will be
// the executable name.
Expand Down
1 change: 1 addition & 0 deletions fuzz/fuzz_targets/fuzz_ed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ fuzz_target!(|x: (Vec<u8>, Vec<u8>)| {
} else {
return;
}
fs::create_dir_all("target").unwrap();
let diff = diff_w(&from, &to, "target/fuzz.file").unwrap();
File::create("target/fuzz.file.original")
.unwrap()
Expand Down
1 change: 1 addition & 0 deletions fuzz/fuzz_targets/fuzz_normal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ fuzz_target!(|x: (Vec<u8>, Vec<u8>)| {
return
}*/
let diff = normal_diff::diff(&from, &to, &Params::default());
fs::create_dir_all("target").unwrap();
File::create("target/fuzz.file.original")
.unwrap()
.write_all(&from)
Expand Down
1 change: 1 addition & 0 deletions fuzz/fuzz_targets/fuzz_patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fuzz_target!(|x: (Vec<u8>, Vec<u8>, u8)| {
} else {
return
}*/
fs::create_dir_all("target").unwrap();
let diff = unified_diff::diff(
&from,
&to,
Expand Down
3 changes: 2 additions & 1 deletion fuzz/fuzz_targets/fuzz_side.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extern crate libfuzzer_sys;

use diffutilslib::side_diff;

use std::fs::File;
use std::fs::{self, File};
use std::io::Write;
use diffutilslib::params::Params;

Expand All @@ -21,6 +21,7 @@ fuzz_target!(|x: (Vec<u8>, Vec<u8>, /* usize, usize */ bool)| {
expand_tabs: expand,
..Default::default()
};
fs::create_dir_all("target").unwrap();
let mut output_buf = vec![];
side_diff::diff(&original, &new, &mut output_buf, &params);
File::create("target/fuzz.file.original")
Expand Down
Loading