diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2003-08-21 08:14:20 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2003-08-21 08:14:20 +0000 |
commit | addedfba95739f3356be1a0cd5e83cbbbdd6c06f (patch) | |
tree | f5095067f308e925b4f2015799f3af6f570b68a5 /lib | |
parent | d45ae142eb4acaded9661e392962856d13bfcb9f (diff) |
Do not produce a corrupt BIGNUM when adding 0 to 0 using BN_add_word().
ok markus@
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 988e0ca7b37..ab858d70ff6 100644 --- a/lib/libssl/src/crypto/bn/bn_word.c +++ b/lib/libssl/src/crypto/bn/bn_word.c @@ -110,6 +110,9 @@ int BN_add_word(BIGNUM *a, BN_ULONG w) BN_ULONG l; int i; + if ((w & BN_MASK2) == 0) + return(1); + if (a->neg) { a->neg=0; |