From mboxrd@z Thu Jan 1 00:00:00 1970 From: ben.whitten at gmail.com Date: Tue, 29 Dec 2015 14:34:27 +0000 Subject: [U-Boot] [PATCH] Fix GCC format-security errors. Message-ID: <1451399667-32519-1-git-send-email-ben.whitten@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Ben Whitten With format-security errors turned on, GCC picks up the use of sprintf without a format parameter. Signed-off-by: Ben Whitten --- 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