]> 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:46:55 +0000 (10:46 +0100)
commit8f83d095fabf9e3e9e23023a010e50a21810d918
treef4f44a126e0d8e3a8daa7c4ed667cd64d5b9fe8a
parent69b914a99e24da875f9f4f2449ec9a6126ac3bc2
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