Skip to content

Commit

Permalink
eof: Fix parsing header
Browse files Browse the repository at this point in the history
Fixes the bug introduced in #947
where reading the version byte is missing the bounds check.
  • Loading branch information
chfast committed Jul 24, 2024
1 parent 6a792b3 commit 1d357c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/evmone/eof.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ bool append_data_section(bytes& container, bytes_view aux_data)

uint8_t get_eof_version(bytes_view container) noexcept
{
return is_eof_container(container) ? container[2] : 0;
return (is_eof_container(container) && container.size() >= 3) ? container[2] : 0;
}

EOFValidationError validate_eof(
Expand Down

0 comments on commit 1d357c2

Please sign in to comment.