From 0df53cbdd98a663b63eb9b90db7d4e1b105f1d0e Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Thu, 1 Dec 2022 02:58:41 +0000 Subject: BN_one() can fail, check its return value. --- regress/lib/libcrypto/exp/exptest.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/regress/lib/libcrypto/exp/exptest.c b/regress/lib/libcrypto/exp/exptest.c index e6260071b9d..ea744c22ea0 100644 --- a/regress/lib/libcrypto/exp/exptest.c +++ b/regress/lib/libcrypto/exp/exptest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exptest.c,v 1.8 2021/11/18 15:17:31 tb Exp $ */ +/* $OpenBSD: exptest.c,v 1.9 2022/12/01 02:58:40 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -110,11 +110,13 @@ test_exp_mod_zero(void) goto err; if ((m = BN_new()) == NULL) goto err; - BN_one(m); + if (!BN_one(m)) + goto err; if ((a = BN_new()) == NULL) goto err; - BN_one(a); + if (!BN_one(a)) + goto err; if ((p = BN_new()) == NULL) goto err; -- cgit v1.2.3