+++ This bug was initially created as a clone of Bug #2091549 +++
Zdenek Sojka reported that strncpy does not always clear the destination buffer. The upstream bug gives the following reproducer:
#define N 3
__asm__ volatile ("xxspltib 18, 0xf":::"vs18");
strncpy (c, a, N);
for (unsigned i = 0; i < N; i++)
The fix has been applied upstream for glibc 2.36 and has been backported to all affected versions (glibc >= 2.33).
Commit for glibc 2.36:
Commit for glibc 2.33:
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 (glibc bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.