summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2003-08-21 08:14:19 +0000
committerotto <otto@openbsd.org>2003-08-21 08:14:19 +0000
commit370d1fc7757aa0424d2824b0c2690ffaf282c34f (patch)
treeb5443191a585782f513edb0915477f67d4c70ec0 /lib/libssl/src
parentA port of the g++ bugfix found at (diff)
downloadwireguard-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.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;