Fix a compliance issue after memory DoS fix
@@ -105,8 +105,10 @@ impl Memory {
value: &[u8],
target_size: Option<usize>
) -> Result<(), ExitFatal> {
- if value.is_empty() {
- return Ok(())
+ match target_size {
+ Some(target_size) if target_size == 0 => return Ok(()),
+ None if value.is_empty() => return Ok(()),
+ _ => (),
}
let target_size = target_size.unwrap_or(value.len());
