Skip to content

Commit

Permalink
Fix initial page size maximum
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed Mar 16, 2024
1 parent 105914a commit 94165df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion soroban-env-host/src/vm/parsed_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,10 @@ impl ParsedModule {
&[],
));
}
if mem.initial > 0xffff {
if (mem.initial as u64)
.saturating_mul(crate::vm::WASM_STD_MEM_PAGE_SIZE_IN_BYTES as u64)
> u32::MAX as u64
{
return Err(host.err(
ScErrorType::WasmVm,
ScErrorCode::InvalidInput,
Expand Down

0 comments on commit 94165df

Please sign in to comment.