Skip to content

Commit

Permalink
Experiment with cargo fuzz
Browse files Browse the repository at this point in the history
This seems to find at least some issues, which I'll investigate.
  • Loading branch information
emk committed Mar 5, 2017
1 parent 90d29b7 commit 5fb20f0
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vobsub/fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

target
libfuzzer
corpus
artifacts
22 changes: 22 additions & 0 deletions vobsub/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

[package]
name = "vobsub-fuzz"
version = "0.0.1"
authors = ["Automatically generated"]
publish = false

[package.metadata]
cargo-fuzz = true

[dependencies.vobsub]
path = ".."
[dependencies.libfuzzer-sys]
git = "https://github.com/rust-fuzz/libfuzzer-sys.git"

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

[[bin]]
name = "fuzzer_script_1"
path = "fuzzers/fuzzer_script_1.rs"
11 changes: 11 additions & 0 deletions vobsub/fuzz/fuzzers/fuzzer_script_1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#![no_main]

extern crate libfuzzer_sys;
extern crate vobsub;

#[export_name="rust_fuzzer_test_input"]
pub extern fn go(data: &[u8]) {
for _ in vobsub::subtitles(data) {
// Just parse and ignore.
}
}

0 comments on commit 5fb20f0

Please sign in to comment.