* [LTP] [PATCH] pidfd_send_signal03: fix compile error with -Werror=format-security flag
@ 2019-12-05 6:30 Yi Zhao
2019-12-05 6:59 ` Li Wang
0 siblings, 1 reply; 2+ messages in thread
From: Yi Zhao @ 2019-12-05 6:30 UTC (permalink / raw)
To: ltp
Fixed when compile with "-Wformat -Wformat-security -Werror=format-security":
In file included from ../../../../include/tst_test.h:85,
from pidfd_send_signal.h:10,
from pidfd_send_signal03.c:21:
pidfd_send_signal03.c: In function 'verify_pidfd_send_signal':
../../../../include/tst_safe_file_ops.h:53:27: error: format not a string literal and no format arguments [-Werror=format-security]
53 | (path), (fmt), ## __VA_ARGS__)
| ^~~~~
pidfd_send_signal03.c:62:3: note: in expansion of macro 'SAFE_FILE_PRINTF'
62 | SAFE_FILE_PRINTF(last_pid_file, pid_str);
| ^~~~~~~~~~~~~~~~
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
.../kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
index 27dbc6626..19d943d06 100644
--- a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
+++ b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
@@ -59,7 +59,7 @@ static void verify_pidfd_send_signal(void)
/* Manipulate PID for next process */
sprintf(pid_str, "%d", pid - 1);
- SAFE_FILE_PRINTF(last_pid_file, pid_str);
+ SAFE_FILE_PRINTF(last_pid_file, "%s", pid_str);
new_pid = SAFE_FORK();
if (new_pid == 0) {
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [LTP] [PATCH] pidfd_send_signal03: fix compile error with -Werror=format-security flag
2019-12-05 6:30 [LTP] [PATCH] pidfd_send_signal03: fix compile error with -Werror=format-security flag Yi Zhao
@ 2019-12-05 6:59 ` Li Wang
0 siblings, 0 replies; 2+ messages in thread
From: Li Wang @ 2019-12-05 6:59 UTC (permalink / raw)
To: ltp
Pushed. Thanks for the fix.
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20191205/2f9e6384/attachment.htm>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-05 6:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05 6:30 [LTP] [PATCH] pidfd_send_signal03: fix compile error with -Werror=format-security flag Yi Zhao
2019-12-05 6:59 ` Li Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.