Skip to content

Commit

Permalink
Fix small issues with fuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
jpikl committed Jul 10, 2023
1 parent 4a8d29f commit 5a057a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
9 changes: 4 additions & 5 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "rew-fuzz"
version = "0.0.0"
publish = false
edition = "2021"
publish = false

[package.metadata]
cargo-fuzz = true
Expand All @@ -11,15 +11,14 @@ cargo-fuzz = true
libfuzzer-sys = "0.4"
rew = { path = ".." }

# Prevent this from interfering with workspaces
[workspace]
members = ["."]
members = ["."] # Prevent this from interfering with workspaces

[profile.release]
debug = 1

[[bin]]
name = "fuzz_target_1"
path = "fuzz_targets/x_parser.rs"
name = "rew-x-parser"
path = "fuzz_targets/rew-x-parser.rs"
test = false
doc = false
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use rew::Pattern;
fuzz_target!(|data: &[u8]| {
if let Ok(text) = std::str::from_utf8(data) {
let mut chars = text.chars();
if let Some(escape) = chars.next() {
Pattern::parse(chars.as_str(), escape);
let _ignore_result = if let Some(escape) = chars.next() {
Pattern::parse(chars.as_str(), escape)
} else {
Pattern::parse(text, '\\');
}
Pattern::parse(text, '\\')
};
}
});
1 change: 1 addition & 0 deletions xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "xtask"
version = "0.0.0"
edition = "2021"
publish = false

[dependencies]
anyhow = "1.0.71"
Expand Down

0 comments on commit 5a057a8

Please sign in to comment.