Skip to content

Commit

Permalink
[rs] Add fuzzer
Browse files Browse the repository at this point in the history
  • Loading branch information
stusmall authored and demurgos committed Apr 6, 2019
1 parent 2559dcf commit 1f6302a
Show file tree
Hide file tree
Showing 4 changed files with 337 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rs/fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

target
corpus
artifacts
301 changes: 301 additions & 0 deletions rs/fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions rs/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

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

[package.metadata]
cargo-fuzz = true

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

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

[[bin]]
name = "movie"
path = "fuzz_targets/movie.rs"
10 changes: 10 additions & 0 deletions rs/fuzz/fuzz_targets/movie.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#![no_main]
#[macro_use] extern crate libfuzzer_sys;
extern crate swf_parser;

//use swf_parser;
//use swf_tree;

fuzz_target!(|data: &[u8]| {
let _ = swf_parser::parsers::movie::parse_movie(&data[..]);
});

0 comments on commit 1f6302a

Please sign in to comment.