libafl_nyx: Add bounds check for Nyx input buffer (#1963)
This commit is contained in:
parent
a0d4a5b240
commit
f448b6fb24
@ -55,6 +55,16 @@ where
|
|||||||
|
|
||||||
let bytes = input.target_bytes();
|
let bytes = input.target_bytes();
|
||||||
let buffer = bytes.as_slice();
|
let buffer = bytes.as_slice();
|
||||||
|
|
||||||
|
if buffer.len() > self.helper.nyx_process.input_buffer_size() {
|
||||||
|
return Err(Error::illegal_state(format!(
|
||||||
|
"Input does not fit in the Nyx input buffer.\
|
||||||
|
You may want to increase the Nyx input buffer size: {} > {}",
|
||||||
|
buffer.len(),
|
||||||
|
self.helper.nyx_process.input_buffer_size()
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
let size = u32::try_from(buffer.len())
|
let size = u32::try_from(buffer.len())
|
||||||
.map_err(|_| Error::unsupported("Inputs larger than 4GB are not supported"))?;
|
.map_err(|_| Error::unsupported("Inputs larger than 4GB are not supported"))?;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user