]> 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 10:07:26 +0000 (11:07 +0100)
commit94417f6c26d6e6a2f0728b8e2cdacfb939689bce
tree2e5c5f889c9a3554d0e75afb6d2442326fca9357
parenta0bc5dd3bed4b04814047265b3bcead7ab973b87
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