Make do_mremap only check new_addr for wraparound if MREMAP_FIXED was

fixed, as new_addr may be meaningless otherwise. Fix to #204484.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11965
This commit is contained in:
Tom Hughes 2011-08-11 14:51:47 +00:00
parent 74c0b9293d
commit e4d325a237

View File

@ -278,8 +278,9 @@ SysRes do_mremap( Addr old_addr, SizeT old_len,
goto eINVAL;
/* reject wraparounds */
if (old_addr + old_len < old_addr
|| new_addr + new_len < new_len)
if (old_addr + old_len < old_addr)
goto eINVAL;
if (f_fixed == True && new_addr + new_len < new_len)
goto eINVAL;
/* kernel rejects all fixed, no-move requests (which are