From: Steven Rostedt <rostedt@goodmis.org>
To: Colin King <colin.king@canonical.com>
Cc: Li Bin <huawei.libin@huawei.com>,
Russell King <rmk+kernel@arm.linux.org.uk>,
Will Deacon <will.deacon@arm.com>,
linux-kernel@vger.kernel.org,
Fengguang Wu <fengguang.wu@intel.com>
Subject: Re: [PATCH] scripts: recordmcount: fix incorrect use of sprintf
Date: Mon, 4 Jan 2016 10:42:46 -0500 [thread overview]
Message-ID: <20160104104246.636bc47a@gandalf.local.home> (raw)
In-Reply-To: <1451516801-16951-1-git-send-email-colin.king@canonical.com>
On Wed, 30 Dec 2015 23:06:41 +0000
Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Fix build warning:
>
> scripts/recordmcount.c:589:4: warning: format not a string
> literal and no format arguments [-Wformat-security]
> sprintf("%s: failed\n", file);
>
> Fixes: a50bd43935586 ("ftrace/scripts: Have recordmcount copy the object file")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> scripts/recordmcount.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
> index 301d70b..e1675927 100644
> --- a/scripts/recordmcount.c
> +++ b/scripts/recordmcount.c
> @@ -586,7 +586,7 @@ main(int argc, char *argv[])
> do_file(file);
> break;
> case SJ_FAIL: /* error in do_file or below */
> - sprintf("%s: failed\n", file);
> + fprintf(stderr, "%s: failed\n", file);
Paper bag bug. I'm not sure how this passed my tests? My tests check
for warnings. And I even got a "BUILD SUCCESS" from Fengguang Wu's
kbuild test robot.
I'll apply it, test it, and push it out soon.
Thanks!
-- Steve
> ++n_error;
> break;
> case SJ_SUCCEED: /* premature success */
next prev parent reply other threads:[~2016-01-04 15:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-30 23:06 Colin King
2016-01-04 15:42 ` Steven Rostedt [this message]
2016-01-06 11:28 ` Fengguang Wu
2016-01-06 23:13 ` Kees Cook
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=20160104104246.636bc47a@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=colin.king@canonical.com \
--cc=fengguang.wu@intel.com \
--cc=huawei.libin@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=will.deacon@arm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®