summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp/ltp/0001-ptrace01-Fix-missing-format-string.patch
blob: 27b890e22bfc1a9d7acffed53f2219d9e86c860c (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
29
30
31
32
33
From adb9587466a493fdd9d4410f1b8b130ebca06daa Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 19 May 2020 22:21:23 -0700
Subject: [PATCH] ptrace01: Fix missing format string

Fixes
| ptrace01.c:89:2: error: format string is not a string literal
(potentially insecure) [-Werror,-Wformat-security]
|         tst_res(TINFO, tc->message);
|         ^              ~~~~~~~~~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Backport [58424835952641f4fd60c0ae3ab6c64decca3f8a]
---
 testcases/kernel/syscalls/ptrace/ptrace01.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/ptrace/ptrace01.c b/testcases/kernel/syscalls/ptrace/ptrace01.c
index 87a99e4150..9071bbabaf 100644
--- a/testcases/kernel/syscalls/ptrace/ptrace01.c
+++ b/testcases/kernel/syscalls/ptrace/ptrace01.c
@@ -86,7 +86,7 @@ static void run(unsigned int i)
 
 	got_signal = 0;
 
-	tst_res(TINFO, tc->message);
+	tst_res(TINFO, "%s", tc->message);
 
 	if (tc->handler == 1) {
 		parent_act.sa_handler = parent_handler;
-- 
2.26.2