Skip to content

Commit

Permalink
Merge pull request #5 from sigaloid/main
Browse files Browse the repository at this point in the history
feat(fuzz): add afl-based fuzzing
  • Loading branch information
mindeng authored Jul 11, 2024
2 parents 9b7fdf7 + 96a8b4c commit e20d892
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions afl-fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "afl-fuzz"
version = "0.1.0"
edition = "2021"

[dependencies]
afl = "0.15.8"
nom-exif = { version = "1.2.1", path = ".." }
11 changes: 11 additions & 0 deletions afl-fuzz/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use std::io::Cursor;

fn main() {
afl::fuzz!(|data: &[u8]| {
let reader = Cursor::new(data);
let _ = nom_exif::parse_metadata(reader.clone());
let _ = nom_exif::parse_heif_exif(reader.clone());
let _ = nom_exif::parse_jpeg_exif(reader.clone());
let _ = nom_exif::parse_mov_metadata(reader.clone());
});
}

0 comments on commit e20d892

Please sign in to comment.