Skip to content

Commit

Permalink
Merge #126
Browse files Browse the repository at this point in the history
126: Fix fuzz targets r=frewsxcv a=neosilky

I wrongly added `.unwrap()` to some of the fuzz targets I committed a while back. They would produce false positives so I removed them.

Thanks to @Shnatsel in #125 for pointing this out.

Co-authored-by: Daniel Lockyer <[email protected]>
  • Loading branch information
bors[bot] and Daniel Lockyer committed Jul 8, 2018
2 parents 1c97264 + d1ea072 commit d6685c7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,7 @@ pub fn fuzz_obj_load(data: &[u8]) {
use std::io::Cursor;

let cursor = Cursor::new(data);

let _: obj::Obj = obj::load_obj(cursor).unwrap();
let _: Result<obj::Obj, obj::ObjError> = obj::load_obj(cursor);
}

#[inline(always)]
Expand All @@ -398,9 +397,9 @@ pub fn fuzz_lewton_read(data: &[u8]) {

let cursor = Cursor::new(data);

let mut reader = lewton::inside_ogg::OggStreamReader::new(cursor).unwrap();

while let Some(_) = reader.read_dec_packet().unwrap() {}
if let Ok(mut reader) = lewton::inside_ogg::OggStreamReader::new(cursor) {
while let Ok(Some(_)) = reader.read_dec_packet() {}
}
}

#[inline(always)]
Expand Down

0 comments on commit d6685c7

Please sign in to comment.