Skip to content

Commit

Permalink
Ensure that wasm preamble has both fields completely
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Mar 14, 2018
1 parent 89e5ea4 commit 3fdfad7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/hera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@ struct hera_instance : evm_instance {
namespace {

bool hasWasmPreamble(vector<uint8_t> const& _input) {
return _input.size() >= 5 && _input[0] == 0 && _input[1] == 'a' && _input[2] == 's' && _input[3] == 'm' && _input[4] == 1;
return
_input.size() >= 8 &&
_input[0] == 0 &&
_input[1] == 'a' &&
_input[2] == 's' &&
_input[3] == 'm' &&
_input[4] == 1 &&
_input[5] == 0 &&
_input[6] == 0 &&
_input[7] == 0;
}

#if HERA_METERING_CONTRACT || HERA_EVM2WASM
Expand Down

0 comments on commit 3fdfad7

Please sign in to comment.