public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Fix GCC format-security errors.
@ 2015-12-29 14:34 ben.whitten at gmail.com
  2015-12-29 16:11 ` Wolfgang Denk
  0 siblings, 1 reply; 6+ messages in thread
From: ben.whitten at gmail.com @ 2015-12-29 14:34 UTC (permalink / raw)
  To: u-boot

From: Ben Whitten <ben.whitten@gmail.com>

With format-security errors turned on, GCC picks up the use of sprintf without
a format parameter.

Signed-off-by: Ben Whitten <ben.whitten@gmail.com>
---
 common/cmd_elf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index 86e694a..3677702 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -289,7 +289,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		} else {
 			tmp = getenv("bootdev");
 			if (tmp)
-				ptr = sprintf(build_buf, tmp);
+				ptr = sprintf(build_buf, "%s", tmp);
 			else
 				printf("## VxWorks boot device not specified\n");

@@ -332,7 +332,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

 			tmp = getenv("othbootargs");
 			if (tmp)
-				ptr += sprintf(build_buf + ptr, tmp);
+				ptr += sprintf(build_buf + ptr, "%s", tmp);

 			memcpy((void *)bootaddr, build_buf,
 			       max(strlen(build_buf), (size_t)255));
--
2.6.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-15 13:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox