diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2003-09-25 19:55:37 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2003-09-25 19:55:37 +0000 |
commit | b2ada990e5f93d5c2514e8bda5b45d16eb58f136 (patch) | |
tree | 7174c6ffeb53f320f4caf3d30df8bbd05956dafe /lib | |
parent | 526a437cd7806229ea10bc0fcc959e486d4d19c5 (diff) |
Return immediately if argument to BN_sub_word is zero.
ok markus@ deraadt@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libssl/src/crypto/bn/bn_word.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libssl/src/crypto/bn/bn_word.c b/lib/libssl/src/crypto/bn/bn_word.c index ab858d70ff6..de610ce54c2 100644 --- a/lib/libssl/src/crypto/bn/bn_word.c +++ b/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; |