Be on the safe side when checking the size of data to be written to an area (overflow).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13299 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f8570b7199
commit
047ab3f955
@ -1064,6 +1064,8 @@ write_user_memory(void *_address, const void *_buffer, int32 size,
|
||||
}
|
||||
|
||||
// restrict this round of writing to the found area
|
||||
if (toWrite > (int32)areaInfo.size)
|
||||
toWrite = areaInfo.size;
|
||||
if (address + toWrite > (char*)areaInfo.address + areaInfo.size)
|
||||
toWrite = (char*)areaInfo.address + areaInfo.size - address;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user