Skip to content

Commit

Permalink
Fix overflow when calculating max allowed size of memory (4Gb)
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 committed Jan 10, 2022
1 parent 31f4479 commit 20cb1a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fizzy/limits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ constexpr uint32_t PageSize = 65536;
/// Convert memory size in pages to size in bytes.
inline constexpr uint64_t memory_pages_to_bytes(uint32_t pages) noexcept
{
return pages * PageSize;
return uint64_t{pages} * PageSize;
}

/// The maximum memory page limit as defined by the specification.
Expand Down

0 comments on commit 20cb1a0

Please sign in to comment.