Zdenek Sojka reported that strncpy does not always clear the destination buffer. The upstream bug gives the following reproducer: #include <string.h> #include <stdlib.h> #define N 3 char a[N]; char c[N]; int main (void) { __asm__ volatile ("xxspltib 18, 0xf":::"vs18"); strncpy (c, a, N); for (unsigned i = 0; i < N; i++) if (c[i]) abort (); return 0; }
The fix has been applied upstream for glibc 2.36 and has been backported to glibc >= 2.33. Commit for glibc 2.36: https://sourceware.org/git/?p=glibc.git;a=commit;h=0218463dd8265ed937622f88ac68c7d984fe0cfc Commit for glibc 2.34: https://sourceware.org/git/?p=glibc.git;a=commit;h=4c92a1041257c0155c6aa7a182fe5f78e477b0e6
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. https://access.redhat.com/errata/RHBA-2022:8272