linux-user/mmap.c: fix integer underflow during mremap shrink
PATCH 1/1 linux-user/mmap.c: fix integer underflow during mremap shrink
Signed-off-by Jonathan Marler <[email protected]>
--- linux-user/mmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
linux-user/mmap.c +2 -1
@@ -708,7 +708,8 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,if (prot ==0 ) { host_addr =mremap (g2h (old_addr), old_size, new_size, flags);if (host_addr !=MAP_FAILED && reserved_va && old_size > new_size) { -mmap_reserve (old_addr + old_size, new_size - old_size); +if (new_size > old_size) +mmap_reserve (old_addr + old_size, new_size - old_size); } }else { errno =ENOMEM ;
Signature · 1 line
2.23.1