X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fbn%2Fbn_shift.c;h=70f785ea185b8841e415d33b385bf96de95535be;hb=c237de058f91072b5d54ad9c570049c14df6957e;hp=37c6988da3dfdb1d358855a1a1d3802e3d554837;hpb=03a0848922d3a4b1a6f216df1c2470a6b946cd87;p=oweals%2Fopenssl.git 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;