can't represent 65536 pages #2187
Labels
bug
Something isn't working
🏆 fuzzer-trophy
Bugs found automatically by fuzzers.
📦 lib-types
About wasmer-types
📦 lib-vm
About wasmer-vm
priority-high
High priority issue
Milestone
Describe the bug
Memory minimum and maximum sizes range 0..65536 inclusive. The verifier blocks 65537 and higher. However, wasmer only works on 65535 and lower.
Testcase:
fails:
The line of code in question is:
and the error is that 65536*65536 is 4294967296, which is the first value too large to fit in a
u32
.Wasmer needs to either remove the problematic conversions to bytes keeping the value as pages, use a larger datatype for the byte count, or store it in a 'max-1' format (assuming '0' is unnecessary since we store the absence of a memory differently.)
The text was updated successfully, but these errors were encountered: