mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-18 08:20:44 +00:00
LibWasm: Limit module memory to 65536 pages
The spec mentions this, and anything past that can't be correctly addressed by the 32-bit indices anyhow.
This commit is contained in:
parent
03fe50d5e7
commit
c4d4c657d0
Notes:
sideshowbarker
2024-07-18 10:18:21 +09:00
Author: https://github.com/alimpfard
Commit: c4d4c657d0
Pull-request: https://github.com/SerenityOS/serenity/pull/8488
1 changed files with 3 additions and 0 deletions
|
@ -350,6 +350,9 @@ public:
|
|||
if (size_to_grow == 0)
|
||||
return true;
|
||||
auto new_size = m_data.size() + size_to_grow;
|
||||
// Can't grow past 2^16 pages.
|
||||
if (new_size >= Constants::page_size * 65536)
|
||||
return false;
|
||||
if (auto max = m_type.limits().max(); max.has_value()) {
|
||||
if (max.value() * Constants::page_size < new_size)
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue