mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-08 20:56:13 +00:00
prevent data overflow on 32 bit platform for memory.grow
This commit is contained in:
parent
d9c01b39d1
commit
dfcadc6202
|
@ -1253,6 +1253,12 @@ wasm_mremap_linear_memory(void *mapped_mem, uint64 old_size, uint64 new_size,
|
||||||
bh_assert(new_size > 0);
|
bh_assert(new_size > 0);
|
||||||
bh_assert(new_size > old_size);
|
bh_assert(new_size > old_size);
|
||||||
|
|
||||||
|
#if UINTPTR_MAX == UINT32_MAX
|
||||||
|
if (new_size == 4 * (uint64)BH_GB) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (mapped_mem) {
|
if (mapped_mem) {
|
||||||
new_mem = os_mremap(mapped_mem, old_size, new_size);
|
new_mem = os_mremap(mapped_mem, old_size, new_size);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user