summaryrefslogtreecommitdiff
path: root/rtld-copy-terminating-null-in-tunables_strdup-bug-28.patch
blob: 6f7310675b7dff8397b34f4830587290154c59d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From a4f5a3103fc3e7974dbe35b411cba9f670807cde Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@linux-m68k.org>
Date: Mon, 23 Aug 2021 10:19:52 +0200
Subject: [PATCH] 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.
---
 elf/dl-tunables.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
index 8009e54..1666736 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];
 
-- 
1.8.3.1