From patchwork Tue Dec 29 14:34:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Whitten X-Patchwork-Id: 561574 X-Patchwork-Delegate: wd@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 6C3C0140BF5 for ; Wed, 30 Dec 2015 01:53:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=bC3l9nic; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 25D1D4B98A; Tue, 29 Dec 2015 15:53:34 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id imM3wjH7Fyk8; Tue, 29 Dec 2015 15:53:33 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7CAEC4B970; Tue, 29 Dec 2015 15:53:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3653A4B94F for ; Tue, 29 Dec 2015 15:34:50 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5ED5sYCoNudY for ; Tue, 29 Dec 2015 15:34:50 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by theia.denx.de (Postfix) with ESMTPS id 0C9974B946 for ; Tue, 29 Dec 2015 15:34:46 +0100 (CET) Received: by mail-wm0-f48.google.com with SMTP id f206so39584562wmf.0 for ; Tue, 29 Dec 2015 06:34:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=aC+5EvRlctqfv4mxOgJjV9/VCMOUzATu72lCur+x/E8=; b=bC3l9nic+EnNddlHj7hDfYX+cQpsV8ga9fU1yiHQq9SlXbCE45LVQj/Ty+p0bKRw9G VZVIBoseVXFYEWlepAN6F84jhozvCQDNBntFoj65wht1r+pUrrDDNQaihp2gzguKzFO2 xtfb3L9mIiUKLy8dBcF7ku3138Ty4zNYOyfYmona6CiJVkyHpQ1IlrFo7sKJ8FNY37dP 6r3qaKuQdAvYmyClqZ1h5b8oUJeViNAvnsFL1H3WpX9jXuMIB6THp8R/GIJe7equQ+kl umXALqc+xly5r7O6xmmkuL6HKo1wfEvv9Pw5VnW9dY4XH0sz+/Wyg1q3F+AFWyoe06z5 sdqw== X-Received: by 10.28.214.76 with SMTP id n73mr8906400wmg.52.1451399685911; Tue, 29 Dec 2015 06:34:45 -0800 (PST) Received: from Minty.home (host86-184-167-97.range86-184.btcentralplus.com. [86.184.167.97]) by smtp.gmail.com with ESMTPSA id 193sm14743049wmg.16.2015.12.29.06.34.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Dec 2015 06:34:44 -0800 (PST) From: ben.whitten@gmail.com To: u-boot@lists.denx.de Date: Tue, 29 Dec 2015 14:34:27 +0000 Message-Id: <1451399667-32519-1-git-send-email-ben.whitten@gmail.com> X-Mailer: git-send-email 2.6.4 X-Mailman-Approved-At: Tue, 29 Dec 2015 15:53:32 +0100 Cc: Ben Whitten Subject: [U-Boot] [PATCH] Fix GCC format-security errors. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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(-) -- 2.6.4 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));