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:
Michael Lotz 2009-10-22 12:05:50 +00:00
parent e0aad96f94
commit 6bb413270b
2 changed files with 2 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}