summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2003-08-21 08:14:20 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2003-08-21 08:14:20 +0000
commitaddedfba95739f3356be1a0cd5e83cbbbdd6c06f (patch)
treef5095067f308e925b4f2015799f3af6f570b68a5 /lib
parentd45ae142eb4acaded9661e392962856d13bfcb9f (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.c3
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;