From ab87e0a67d14e20b3730f91a14d1117f6349682a Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Thu, 25 Sep 2003 19:55:37 +0000 Subject: Return immediately if argument to BN_sub_word is zero. ok markus@ deraadt@ --- lib/libcrypto/bn/bn_word.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libcrypto/bn') diff --git a/lib/libcrypto/bn/bn_word.c b/lib/libcrypto/bn/bn_word.c index ab858d70ff6..de610ce54c2 100644 --- a/lib/libcrypto/bn/bn_word.c +++ b/lib/libcrypto/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