summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_prime.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2016-11-15 18:54:28 -0500
committerRich Salz <rsalz@openssl.org>2016-11-15 18:54:28 -0500
commit78e09b53a40729f5e99829ccc733b592bd22fea1 (patch)
tree4c19eccd305fa6889f59f9d7b929ffb8f07294e0 /crypto/bn/bn_prime.c
parentdfc3ffe50251463b4af7deeac3d407667f9050a3 (diff)
Check return value of some BN functions.
Factorise multiple bn_get_top(group->field) calls Add missing checks on some conditional BN_copy return value Add missing checks on some BN_copy return value Add missing checks on a few bn_wexpand return value Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1626)
Diffstat (limited to 'crypto/bn/bn_prime.c')
-rw-r--r--crypto/bn/bn_prime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/bn/bn_prime.c b/crypto/bn/bn_prime.c
index 51969583e7..7103acfe0b 100644
--- a/crypto/bn/bn_prime.c
+++ b/crypto/bn/bn_prime.c
@@ -240,7 +240,8 @@ int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
BIGNUM *t;
if ((t = BN_CTX_get(ctx)) == NULL)
goto err;
- BN_copy(t, a);
+ if (BN_copy(t, a) == NULL)
+ goto err;
t->neg = 0;
A = t;
} else