From c6223f04e5580b6affc19d5f7518c523814b7da8 Mon Sep 17 00:00:00 2001 From: otto <> Date: Thu, 25 Sep 2003 19:55:36 +0000 Subject: Return immediately if argument to BN_sub_word is zero. ok markus@ deraadt@ --- src/lib/libssl/src/crypto/bn/bn_word.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lib/libssl') diff --git a/src/lib/libssl/src/crypto/bn/bn_word.c b/src/lib/libssl/src/crypto/bn/bn_word.c index ab858d70ff..de610ce54c 100644 --- a/src/lib/libssl/src/crypto/bn/bn_word.c +++ b/src/lib/libssl/src/crypto/bn/bn_word.c @@ -146,6 +146,9 @@ int BN_sub_word(BIGNUM *a, BN_ULONG w) { int i; + if ((w & BN_MASK2) == 0) + return(1); + if (BN_is_zero(a) || a->neg) { a->neg=0; -- cgit v1.2.3-55-g6feb