+++ This bug was initially created as a clone of Bug #1662841 +++
Under rare circumstances, the realloc implementation in glibc may not copy the entire allocation. We need to backport this upstream commit:
Author: Florian Weimer <firstname.lastname@example.org>
Date: Mon Dec 31 22:04:36 2018 +0100
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.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.