Skip to content

Commit

Permalink
tmp: alternative API layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ctz committed Sep 23, 2024
1 parent da42e4b commit 4c04e90
Show file tree
Hide file tree
Showing 4 changed files with 384 additions and 406 deletions.
8 changes: 5 additions & 3 deletions fuzz/fuzz_targets/pem.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#![no_main]

use std::io::BufReader;
use std::hint::black_box;
use std::io::Cursor;

use libfuzzer_sys::fuzz_target;

use rustls_pki_types::pem;

fuzz_target!(|data: &[u8]| {
for x in pem::Item::iter_from_buf(&mut BufReader::new(data)) {
for x in pem::iter_from_reader(&mut Cursor::new(data)) {
let _ = black_box(x);
}

let _ = black_box(pem::Item::from_slice(data));
for x in pem::iter_from_slice(data) {
let _ = black_box(x);
}
});
Loading

0 comments on commit 4c04e90

Please # to comment.