diff options
| author | William Todd Stinson <stinson@lindenlab.com> | 2012-11-06 12:13:45 -0800 |
|---|---|---|
| committer | William Todd Stinson <stinson@lindenlab.com> | 2012-11-06 12:13:45 -0800 |
| commit | 6291762bc404c77d03aed9c23a37e0b4b91bc0b0 (patch) | |
| tree | de4f1a34870c0195446f2a043984f20ed11da072 /indra/llcommon | |
| parent | 814c875a25dcf026779f44c06d9a225c669e1b01 (diff) | |
| parent | bfd6a0c6b9bb4b05d6705c722d330b49195d5b0c (diff) | |
Pull and merge from ssh://hg@bitbucket.org/lindenlab/viewer-beta.
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; |
