From patchwork Fri Jan 12 08:04:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Etnestad X-Patchwork-Id: 859785 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zJ10Z5xrsz9s75 for ; Fri, 12 Jan 2018 22:36:14 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 55A62C22186; Fri, 12 Jan 2018 11:34:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4BB66C22135; Fri, 12 Jan 2018 11:32:55 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 02C05C21C62; Fri, 12 Jan 2018 08:04:47 +0000 (UTC) Received: from mailcluster2.itpays.net (mailcluster1.itpays.net [193.107.29.193]) by lists.denx.de (Postfix) with ESMTPS id 14B5EC21C54 for ; Fri, 12 Jan 2018 08:04:46 +0000 (UTC) Received: from met-workstation.appeartv.lan (unknown [195.159.183.42]) by mailcluster2.itpays.net (Postfix) with ESMTPA id 7DDE420FEC; Fri, 12 Jan 2018 09:04:42 +0100 (CET) From: Martin Etnestad To: trini@konsulko.com, u-boot@lists.denx.de Date: Fri, 12 Jan 2018 09:04:38 +0100 Message-Id: <20180112080438.26056-1-martin.etnestad@appeartv.com> X-Mailer: git-send-email 2.15.1 X-Mailman-Approved-At: Fri, 12 Jan 2018 11:32:51 +0000 Subject: [U-Boot] [PATCH] Initialize SHA buffer size var in passwd_abort X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" The call to hash_block in passwd_abort fails with error ENOSPC on some systems. The reason is that the variable which specifies the size of the buffer to contain the computed hash does not get initialized. This patch initializes the variable with the size of the buffer. Signed-off-by: Martin Etnestad --- common/autoboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/autoboot.c b/common/autoboot.c index a011865028..2eef7a04cc 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -57,7 +57,7 @@ static int passwd_abort(uint64_t etime) const char *algo_name = "sha256"; u_int presskey_len = 0; int abort = 0; - int size; + int size = sizeof(sha); int ret; if (sha_env_str == NULL)