From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Fix GCC format-security errors.
Date: Tue, 29 Dec 2015 17:11:57 +0100 [thread overview]
Message-ID: <20151229161157.F191F383BF2@gemini.denx.de> (raw)
In-Reply-To: <1451399667-32519-1-git-send-email-ben.whitten@gmail.com>
Dear Ben,
In message <1451399667-32519-1-git-send-email-ben.whitten@gmail.com> you wrote:
> From: Ben Whitten <ben.whitten@gmail.com>
>
> With format-security errors turned on, GCC picks up the use of sprintf without
> a format parameter.
Thanks for detecting this, but...
> - ptr = sprintf(build_buf, tmp);
> + ptr = sprintf(build_buf, "%s", tmp);
...
> - ptr += sprintf(build_buf + ptr, tmp);
> + ptr += sprintf(build_buf + ptr, "%s", tmp);
... why should we use sprintf() here at all? I recommend to convert
this into a plain strcpy().
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Any fool can make things bigger, more complex, and more violent. It
takes a touch of genius - and a lot of courage - to move in the
opposite direction. - Albert Einstein
next prev parent reply other threads:[~2015-12-29 16:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-29 14:34 [U-Boot] [PATCH] Fix GCC format-security errors ben.whitten at gmail.com
2015-12-29 16:11 ` Wolfgang Denk [this message]
2015-12-30 13:05 ` [U-Boot] [PATCH v2] Fix GCC format-security errors and convert sprintfs ben.whitten at gmail.com
2015-12-31 12:08 ` Wolfgang Denk
2016-01-14 20:08 ` Tom Rini
2016-01-15 13:10 ` [U-Boot] [U-Boot, " Tom Rini
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=20151229161157.F191F383BF2@gemini.denx.de \
--to=wd@denx.de \
--cc=u-boot@lists.denx.de \
/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