diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2022-12-01 02:58:41 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2022-12-01 02:58:41 +0000 |
commit | 0df53cbdd98a663b63eb9b90db7d4e1b105f1d0e (patch) | |
tree | c205da88400d36d17c866625f6dadd5c2ef50ce9 /regress | |
parent | 3af16bce8ae1e7e9fb49a5dde09a8757b1ef0849 (diff) |
BN_one() can fail, check its return value.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/lib/libcrypto/exp/exptest.c | 8 |
1 files 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; |