]> git.ipfire.org Git - thirdparty/glibc.git/commit
malloc: Always call memcpy in _int_realloc [BZ #24027]
authorFlorian Weimer <fw@deneb.enyo.de>
Mon, 31 Dec 2018 21:04:36 +0000 (22:04 +0100)
committerFlorian Weimer <fw@deneb.enyo.de>
Tue, 1 Jan 2019 09:32:37 +0000 (10:32 +0100)
commit22b7478755c07f4741db85d14fc2b57837078ca6
tree2622e80c2f8de61e5378476a3c598cba9fb584eb
parentfcd316654a4510281fff32194b3b9f90e3dfab83
malloc: Always call memcpy in _int_realloc [BZ #24027]

This commit removes the custom memcpy implementation from _int_realloc
for small chunk sizes.  The ncopies variable has the wrong type, and
an integer wraparound could cause the existing code to copy too few
elements (leaving the new memory region mostly uninitialized).
Therefore, removing this code fixes bug 24027.

(cherry picked from commit b50dd3bc8cbb1efe85399b03d7e6c0310c2ead84)
ChangeLog
NEWS
malloc/malloc.c