public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/1] lib/rsa: correct check after allocation in fdt_add_bignum()
@ 2020-08-20 19:11 Heinrich Schuchardt
  2020-08-22 15:09 ` Simon Glass
  2020-08-28 12:53 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2020-08-20 19:11 UTC (permalink / raw)
  To: u-boot

After allocating to pointer ctx we should check that pointer and not
another pointer already checked above.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/rsa/rsa-sign.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c
index 40ca1e1f57..1f0d81bd7a 100644
--- a/lib/rsa/rsa-sign.c
+++ b/lib/rsa/rsa-sign.c
@@ -708,7 +708,7 @@ static int fdt_add_bignum(void *blob, int noffset, const char *prop_name,
 		return -ENOMEM;
 	}
 	ctx = BN_CTX_new();
-	if (!tmp) {
+	if (!ctx) {
 		fprintf(stderr, "Out of memory (bignum context)\n");
 		return -ENOMEM;
 	}
--
2.28.0

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

end of thread, other threads:[~2020-08-28 12:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-20 19:11 [PATCH 1/1] lib/rsa: correct check after allocation in fdt_add_bignum() Heinrich Schuchardt
2020-08-22 15:09 ` Simon Glass
2020-08-28 12:53 ` Tom Rini

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