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 | ab87e0a67d14e20b3730f91a14d1117f6349682a (patch) | |
tree | 9d3f74a8ca1db3ad8dfb1eabc5bdcc2af1ddc5ac /lib/libcrypto/bn | |
parent | 33a0d3d23f58cdb0a4a90262bd6f2d012145a6e3 (diff) |
Return immediately if argument to BN_sub_word is zero.
ok markus@ deraadt@
Diffstat (limited to 'lib/libcrypto/bn')
-rw-r--r-- | lib/libcrypto/bn/bn_word.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |