]> 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>
Mon, 31 Dec 2018 21:09:37 +0000 (22:09 +0100)
commitb50dd3bc8cbb1efe85399b03d7e6c0310c2ead84
tree817ec49386ef014ba0a02926c08579408e9c71ce
parent0b9c84906f653978fb8768c7ebd0ee14a47e662e
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.
ChangeLog
malloc/malloc.c