Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
tokatoka authored and s3bk committed May 16, 2023
1 parent c456949 commit 677152f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions pdf/fuzz/fuzz_targets/parse.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#![no_main]
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: &[u8]| {
if let Ok(p) = pdf::file::File::from_data(data) {
for _ in p.pages() {}
fn harness(data: &[u8]) {
if let Ok(file) = pdf::file::FileOptions::cached().load(data) {
for idx in 0..file.num_pages() {
let _ = file.get_page(idx);
}
}
});
Ok(())
}

fuzz_target!(|data: &[u8]| {
let _ = harness(data);
});

0 comments on commit 677152f

Please sign in to comment.