diff options
author | Oz Linden <oz@lindenlab.com> | 2012-10-19 14:19:22 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2012-10-19 14:19:22 -0400 |
commit | 1b0ea26ecb82b432efd19b319116f94ce58e2b48 (patch) | |
tree | ca47e77fc02b3ca07f22d9702a6e290bf394d5e4 /indra/llcommon | |
parent | 1d3487e2ea106afe48567d645dd5bbc023273cff (diff) | |
parent | f2a674274fc043e55ad3e78e05120d34ed2ff361 (diff) |
merge back late fix for MAINT-1753
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llmemory.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 40cde485cf..10013e0f92 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -87,7 +87,11 @@ inline void* ll_aligned_realloc_16(void* ptr, size_t size, size_t old_size) // r void* ret = ll_aligned_malloc_16(size); if (ptr) { - memcpy(ret, ptr, old_size); + if (ret) + { + // Only copy the size of the smallest memory block to avoid memory corruption. + memcpy(ret, ptr, llmin(old_size, size)); + } ll_aligned_free_16(ptr); } return ret; |