diff options
author | 2003-08-21 08:14:19 +0000 | |
---|---|---|
committer | 2003-08-21 08:14:19 +0000 | |
commit | 370d1fc7757aa0424d2824b0c2690ffaf282c34f (patch) | |
tree | b5443191a585782f513edb0915477f67d4c70ec0 /lib/libssl/src | |
parent | A port of the g++ bugfix found at (diff) | |
download | wireguard-openbsd-370d1fc7757aa0424d2824b0c2690ffaf282c34f.tar.xz wireguard-openbsd-370d1fc7757aa0424d2824b0c2690ffaf282c34f.zip |
Do not produce a corrupt BIGNUM when adding 0 to 0 using BN_add_word().
ok markus@
Diffstat (limited to 'lib/libssl/src')
-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; |