diff mbox series

ptrace01: Fix missing format string

Message ID 20200520052318.3261805-1-raj.khem@gmail.com
State Accepted
Headers show
Series ptrace01: Fix missing format string | expand

Commit Message

Khem Raj May 20, 2020, 5:23 a.m. UTC
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>
---
 testcases/kernel/syscalls/ptrace/ptrace01.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Li Wang May 20, 2020, 5:43 a.m. UTC | #1
On Wed, May 20, 2020 at 1:23 PM Khem Raj <raj.khem@gmail.com> wrote:

> 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>
>

Pushed.
diff mbox series

Patch

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;