public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Initialize SHA buffer size var in passwd_abort
@ 2018-01-12  8:04 Martin Etnestad
  2018-01-28 18:51 ` [U-Boot] " Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Etnestad @ 2018-01-12  8:04 UTC (permalink / raw)
  To: 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 <martin.etnestad@appeartv.com>
---
 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)
-- 
2.15.1

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

* [U-Boot] Initialize SHA buffer size var in passwd_abort
  2018-01-12  8:04 [U-Boot] [PATCH] Initialize SHA buffer size var in passwd_abort Martin Etnestad
@ 2018-01-28 18:51 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2018-01-28 18:51 UTC (permalink / raw)
  To: u-boot

On Fri, Jan 12, 2018 at 09:04:38AM +0100, Martin Etnestad wrote:

> 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 <martin.etnestad@appeartv.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180128/2642fb7f/attachment.sig>

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

end of thread, other threads:[~2018-01-28 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-12  8:04 [U-Boot] [PATCH] Initialize SHA buffer size var in passwd_abort Martin Etnestad
2018-01-28 18:51 ` [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