fuzzing: reject too-large memories
This commit is contained in:
parent
9c84c7d44d
commit
f18c624b9a
|
@ -210,6 +210,7 @@ impl<'a> Context<'a> {
|
||||||
// Live-outs to succ blocks: in this block-local
|
// Live-outs to succ blocks: in this block-local
|
||||||
// handling, model them as uses as the end of the block.
|
// handling, model them as uses as the end of the block.
|
||||||
for &livein in &self.block_end_live[block] {
|
for &livein in &self.block_end_live[block] {
|
||||||
|
let livein = self.body.resolve_alias(livein);
|
||||||
visitor.visitor.visit_use(livein);
|
visitor.visitor.visit_use(livein);
|
||||||
}
|
}
|
||||||
// Visit all insts.
|
// Visit all insts.
|
||||||
|
|
|
@ -34,6 +34,14 @@ pub fn reject(bytes: &[u8]) -> bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
wasmparser::Payload::MemorySection(mut reader) => {
|
||||||
|
for _ in 0..reader.get_count() {
|
||||||
|
let m = reader.read().unwrap();
|
||||||
|
if m.maximum.is_none() || m.maximum.unwrap() > 100 {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue