rtld: copy terminating null in tunables_strdup (bug 28256)
authorAndreas Schwab <schwab@linux-m68k.org>
Mon, 23 Aug 2021 08:19:52 +0000 (10:19 +0200)
committerAndreas Schwab <schwab@linux-m68k.org>
Mon, 23 Aug 2021 13:31:09 +0000 (15:31 +0200)
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.

elf/dl-tunables.c

index 8009e54..1666736 100644 (file)
@@ -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];