The allocation size wasn't updated on an area based realloc that would still
fit into the existing area. In that case further reallocs could then assume the wrong previous size and then not copy enough from the original buffer, leading to lost bytes at the end of the new buffer. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33724 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
e0aad96f94
commit
6bb413270b
@ -2263,6 +2263,7 @@ realloc(void *address, size_t newSize)
|
||||
// there is enough room available for the newSize
|
||||
TRACE(("realloc(): new size %ld fits in old area %ld with %ld "
|
||||
"available\n", newSize, area, available));
|
||||
info->allocation_size = newSize;
|
||||
return address;
|
||||
}
|
||||
|
||||
|
@ -1689,6 +1689,7 @@ realloc(void *address, size_t newSize)
|
||||
// there is enough room available for the newSize
|
||||
INFO(("realloc(): new size %ld fits in old area %ld with %ld "
|
||||
"available\n", newSize, area, available));
|
||||
info->allocation_size = newSize;
|
||||
return address;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user