Skip to content

Commit

Permalink
Fixed vec index out of range in cmpfn.rs (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
maverick117 authored and spinpx committed May 25, 2019
1 parent a041d64 commit b2e0929
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fuzzer/src/search/cmpfn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ impl<'a> FnFuzz<'a> {
let last = self.handler.cond.offsets.last().unwrap();
let off = last.begin as usize;
let mut end = last.end;
if self.handler.buf.len() <= last.end as usize {
self.handler.buf.resize(last.end as usize + 1_usize, 0);
}
let v = self.handler.buf[off];
for _ in 0..n {
self.handler.buf.insert(off, v);
Expand Down

0 comments on commit b2e0929

Please sign in to comment.