From: Andreas Schwab Date: Mon, 23 Aug 2021 08:19:52 +0000 (+0200) Subject: rtld: copy terminating null in tunables_strdup (bug 28256) X-Git-Tag: glibc-2.35~567 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4f5a3103fc3e7974dbe35b411cba9f670807cde;p=thirdparty%2Fglibc.git rtld: copy terminating null in tunables_strdup (bug 28256) Avoid triggering a false positive from valgrind by copying the terminating null in tunables_strdup. At this point the heap is still clean, but valgrind is stricter here. --- diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c index 8009e54ee5d..1666736bc1f 100644 --- a/elf/dl-tunables.c +++ b/elf/dl-tunables.c @@ -56,8 +56,6 @@ tunables_strdup (const char *in) if (out == (void *)-1) _dl_fatal_printf ("sbrk() failure while processing tunables\n"); - i--; - while (i-- > 0) out[i] = in[i];