about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2021-08-23 10:19:52 +0200
committerAndreas Schwab <schwab@linux-m68k.org>2021-08-23 15:31:09 +0200
commita4f5a3103fc3e7974dbe35b411cba9f670807cde (patch)
tree5c91ec9ccc7ad7f65a507bae287336d948bbc19a
parentf2e33c3268db9adf8e57e991676ed0d5ac74e8a8 (diff)
downloadglibc-a4f5a3103fc3e7974dbe35b411cba9f670807cde.tar.gz
glibc-a4f5a3103fc3e7974dbe35b411cba9f670807cde.tar.xz
glibc-a4f5a3103fc3e7974dbe35b411cba9f670807cde.zip
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.
-rw-r--r--elf/dl-tunables.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
index 8009e54ee5..1666736bc1 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];