diff --git a/include/eosio/vm/execution_context.hpp b/include/eosio/vm/execution_context.hpp index 7bdf8d1..f0f33b8 100644 --- a/include/eosio/vm/execution_context.hpp +++ b/include/eosio/vm/execution_context.hpp @@ -171,7 +171,8 @@ namespace eosio { namespace vm { auto required_memory = static_cast(offset) + data_seg.data.size(); EOS_VM_ASSERT(required_memory <= available_memory, wasm_memory_exception, "data out of range"); auto addr = _linear_memory + offset; - memcpy((char*)(addr), data_seg.data.data(), data_seg.data.size()); + if(data_seg.data.size()) + memcpy((char*)(addr), data_seg.data.data(), data_seg.data.size()); } // Globals can be different from one WASM code to another.