diff --git a/libraries/chain/include/eosio/chain/wasm_interface_private.hpp b/libraries/chain/include/eosio/chain/wasm_interface_private.hpp index fa5308d2e297fe7ed409ce8967f517c85d927f43..968b14fb1039f5484858bff93c70bd278a6d29bd 100644 --- a/libraries/chain/include/eosio/chain/wasm_interface_private.hpp +++ b/libraries/chain/include/eosio/chain/wasm_interface_private.hpp @@ -89,7 +89,7 @@ struct array_ptr { static T* validated_ptr (wasm_interface& wasm, U32 ptr, size_t length) { auto mem = getDefaultMemory(intrinsics_accessor::get_context(wasm).code.instance); - if(!mem || ptr + length >= IR::numBytesPerPage*Runtime::getMemoryNumPages(mem)) + if(!mem || ptr + length > IR::numBytesPerPage*Runtime::getMemoryNumPages(mem)) Runtime::causeException(Exception::Cause::accessViolation); return (T*)(getMemoryBaseAddress(mem) + ptr);