All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [COMMITTED] [PATCH 1/2] fcntl36: Do not pass char* pointer to tst_res() fmt
Date: Wed, 17 Jan 2018 15:56:40 +0100	[thread overview]
Message-ID: <20180117145641.21103-1-chrubis@suse.cz> (raw)

The format string has to be constant, passing pointers directly is a bad
practice that may result in security exploit and some build systems even
do not produce packages if such warning is found in the compiler logs.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/syscalls/fcntl/fcntl36.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/fcntl/fcntl36.c b/testcases/kernel/syscalls/fcntl/fcntl36.c
index 6f2eb6b34..3246d1389 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl36.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl36.c
@@ -300,7 +300,7 @@ static void test_fn(void *f0(void *), void *f1(void *),
 	struct param p2[thread_cnt];
 	unsigned char buf[write_size];
 
-	tst_res(TINFO, msg);
+	tst_res(TINFO, "%s", msg);
 
 	if (tst_fill_file(fname, 1, write_size, thread_cnt + 1))
 		tst_brk(TBROK, "Failed to create tst file");
-- 
2.13.6


             reply	other threads:[~2018-01-17 14:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17 14:56 Cyril Hrubis [this message]
2018-01-17 14:56 ` [LTP] [COMMITTED] [PATCH 2/2] endian_switch01: Fix build on older distros Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180117145641.21103-1-chrubis@suse.cz \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.