Fix crash in BN_rshift [from HEAD].
authorAndy Polyakov <appro@openssl.org>
Tue, 28 Oct 2008 13:48:33 +0000 (13:48 +0000)
committerAndy Polyakov <appro@openssl.org>
Tue, 28 Oct 2008 13:48:33 +0000 (13:48 +0000)
PR: 1663

crypto/bn/bn_shift.c

index de9312dce231f5de6c03a90baf42ee867c6b6838..c4d301afc4675b7739ede6517f3cebcde52a285a 100644 (file)
@@ -177,7 +177,7 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
        nw=n/BN_BITS2;
        rb=n%BN_BITS2;
        lb=BN_BITS2-rb;
-       if (nw > a->top || a->top == 0)
+       if (nw >= a->top || a->top == 0)
                {
                BN_zero(r);
                return(1);