Skip to content

Commit 20cb1a0

Browse files
committed
Fix overflow when calculating max allowed size of memory (4Gb)
1 parent 31f4479 commit 20cb1a0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/fizzy/limits.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ constexpr uint32_t PageSize = 65536;
1414
/// Convert memory size in pages to size in bytes.
1515
inline constexpr uint64_t memory_pages_to_bytes(uint32_t pages) noexcept
1616
{
17-
return pages * PageSize;
17+
return uint64_t{pages} * PageSize;
1818
}
1919

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

0 commit comments

Comments
 (0)