summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_shift.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-11-30 22:34:57 +0000
committerBodo Möller <bodo@openssl.org>2000-11-30 22:34:57 +0000
commitfc2e05c2d5c078d1fdf0ee56fc118ea471000a3a (patch)
treeb9edb41a68498466f28371edfae995b493f4defd /crypto/bn/bn_shift.c
parentb2993bdea10ed0c1344ce8b9fa9ddacfe681e822 (diff)
Fix BN_rshift, which caused lots of trouble.
Diffstat (limited to 'crypto/bn/bn_shift.c')
-rw-r--r--crypto/bn/bn_shift.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/bn/bn_shift.c b/crypto/bn/bn_shift.c
index 37c6988da3..70f785ea18 100644
--- a/crypto/bn/bn_shift.c
+++ b/crypto/bn/bn_shift.c
@@ -172,6 +172,11 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
r->neg=a->neg;
if (bn_wexpand(r,a->top-nw+1) == NULL) return(0);
}
+ else
+ {
+ if (n == 0)
+ return 1; /* or the copying loop will go berserk */
+ }
f= &(a->d[nw]);
t=r->d;