From 91f9a880dd4ef4fe49326c757cb480a5cb39cf63 Mon Sep 17 00:00:00 2001 From: pdobacz <5735525+pdobacz@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:47:39 +0200 Subject: [PATCH] Tidy assertions in `validate_header` --- lib/evmone/eof.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/evmone/eof.cpp b/lib/evmone/eof.cpp index a5e2f343cd..20794aba4b 100644 --- a/lib/evmone/eof.cpp +++ b/lib/evmone/eof.cpp @@ -782,9 +782,12 @@ std::variant validate_header( std::vector container_offsets; for (const auto container_size : container_sizes) { + assert(offset <= std::numeric_limits::max()); container_offsets.emplace_back(static_cast(offset)); offset += container_size; } + + assert(offset <= std::numeric_limits::max()); const auto data_offset = static_cast(offset); return EOF1Header{