X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fbn%2Fbn_shift.c;h=0883247384e97a4d8ac9c37f83c4c4a21cb49b96;hp=6dbe77b50fdc51e99c456628b255ccaf55d2f1ec;hb=24bec03beb1d97f7c7b3f0066f3a309800de435f;hpb=6b691a5c85ddc4e407e32781841fee5c029506cd diff --git a/crypto/bn/bn_shift.c b/crypto/bn/bn_shift.c index 6dbe77b50f..0883247384 100644 --- a/crypto/bn/bn_shift.c +++ b/crypto/bn/bn_shift.c @@ -121,7 +121,7 @@ int BN_rshift1(BIGNUM *r, BIGNUM *a) return(1); } -int BN_lshift(BIGNUM *r, BIGNUM *a, int n) +int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) { int i,nw,lb,rb; BN_ULONG *t,*f; @@ -162,7 +162,7 @@ int BN_rshift(BIGNUM *r, BIGNUM *a, int n) nw=n/BN_BITS2; rb=n%BN_BITS2; lb=BN_BITS2-rb; - if (nw > a->top) + if (nw > a->top || a->top == 0) { BN_zero(r); return(1);