From 8c5a2bd6bb9a8c2bb3e1b63c03e57bb1115275d1 Mon Sep 17 00:00:00 2001 From: Nils Larsch Date: Sun, 29 Jan 2006 23:12:22 +0000 Subject: add additional checks + cleanup Submitted by: David Hartman --- crypto/bn/bn_gf2m.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crypto/bn/bn_gf2m.c') diff --git a/crypto/bn/bn_gf2m.c b/crypto/bn/bn_gf2m.c index 00f188ab66..3953b9890d 100644 --- a/crypto/bn/bn_gf2m.c +++ b/crypto/bn/bn_gf2m.c @@ -1018,7 +1018,8 @@ int BN_GF2m_arr2poly(const unsigned int p[], BIGNUM *a) BN_zero(a); for (i = 0; p[i] != 0; i++) { - BN_set_bit(a, p[i]); + if (BN_set_bit(a, p[i]) == 0) + return 0; } BN_set_bit(a, 0); bn_check_top(a); -- cgit v1.2.3