From 94165df3ab288677f68281b2e43fcc3dab8a3ed9 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Fri, 15 Mar 2024 21:51:48 -0700 Subject: [PATCH] Fix initial page size maximum --- soroban-env-host/src/vm/parsed_module.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/soroban-env-host/src/vm/parsed_module.rs b/soroban-env-host/src/vm/parsed_module.rs index 9b1e6512c..4c28b28f7 100644 --- a/soroban-env-host/src/vm/parsed_module.rs +++ b/soroban-env-host/src/vm/parsed_module.rs @@ -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,