test/exptest.c:159: error: BUFFER_OVERRUN_L3
  Offset: [1, +oo] Size: [0, 8388607] by call to `BN_div`.
Showing all 18 steps of the trace


test/exptest.c:149:5: Call
147.       RAND_bytes(&c, 1);
148.       c = (c % BN_BITS) - BN_BITS2;
149.       BN_rand(a, NUM_BITS + c, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY);
           ^
150.   
151.       RAND_bytes(&c, 1);

crypto/bn/bn_rand.c:97:1: Parameter `*rnd->d`
  95.   }
  96.   
  97. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  98.   {
  99.       return bnrand(NORMAL, rnd, bits, top, bottom);

crypto/bn/bn_rand.c:99:12: Call
  97.   int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  98.   {
  99.       return bnrand(NORMAL, rnd, bits, top, bottom);
                    ^
  100.   }
  101.   

crypto/bn/bn_rand.c:21:1: Parameter `*rnd->d`
    19.   } BNRAND_FLAG;
    20.   
    21. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom)
    22.   {
    23.       unsigned char *buf = NULL;

test/exptest.c:157:5: Call
155.       RAND_bytes(&c, 1);
156.       c = (c % BN_BITS) - BN_BITS2;
157.       BN_rand(m, NUM_BITS + c, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD);
           ^
158.   
159.       if (!TEST_true(BN_mod(a, a, m, ctx))

crypto/bn/bn_rand.c:97:1: Parameter `*rnd->d`
  95.   }
  96.   
  97. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  98.   {
  99.       return bnrand(NORMAL, rnd, bits, top, bottom);

crypto/bn/bn_rand.c:99:12: Call
  97.   int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  98.   {
  99.       return bnrand(NORMAL, rnd, bits, top, bottom);
                    ^
  100.   }
  101.   

crypto/bn/bn_rand.c:21:1: Parameter `*rnd->d`
    19.   } BNRAND_FLAG;
    20.   
    21. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom)
    22.   {
    23.       unsigned char *buf = NULL;

test/exptest.c:159:10: Call
157.       BN_rand(m, NUM_BITS + c, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD);
158.   
159.       if (!TEST_true(BN_mod(a, a, m, ctx))
                ^
160.           || !TEST_true(BN_mod(b, b, m, ctx))
161.           || !TEST_true(BN_mod_exp_mont(r_mont, a, b, m, ctx, NULL))

crypto/bn/bn_div.c:188:1: Parameter `*dv->d`
  186.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
  187.    */
  188. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
  189.              BN_CTX *ctx)
  190.   {

crypto/bn/bn_div.c:303:10: Call
  301.   
  302.       /* Setup to 'res' */
  303.       if (!bn_wexpand(res, (loop + 1)))
                  ^
  304.           goto err;
  305.       res->neg = (num->neg ^ divisor->neg);

crypto/bn/bn_lib.c:939:1: Parameter `*a->d`
    937.   }
    938.   
    939. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
    940.   {
    941.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_div.c:456:9: Call
  454.            */
  455.           int neg = num->neg;
  456.           BN_rshift(rm, snum, norm_shift);
                 ^
  457.           if (!BN_is_zero(rm))
  458.               rm->neg = neg;

crypto/bn/bn_shift.c:122:1: <Length trace>
120.   }
121.   
122. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
123.   {
124.       int i, j, nw, lb, rb;

crypto/bn/bn_shift.c:122:1: Parameter `*a->d`
    120.   }
    121.   
    122. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
    123.   {
    124.       int i, j, nw, lb, rb;

crypto/bn/bn_shift.c:153:5: Assignment
    151.       }
    152.   
    153.       f = &(a->d[nw]);
               ^
    154.       t = r->d;
    155.       j = a->top - nw;

crypto/bn/bn_shift.c:162:15: Assignment
    160.               *(t++) = *(f++);
    161.       } else {
    162.           l = *(f++);
                         ^
    163.           for (i = j - 1; i != 0; i--) {
    164.               tmp = (l >> rb) & BN_MASK2;

crypto/bn/bn_shift.c:165:17: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_div` 
    163.           for (i = j - 1; i != 0; i--) {
    164.               tmp = (l >> rb) & BN_MASK2;
    165.               l = *(f++);
                           ^
    166.               *(t++) = (tmp | (l << lb)) & BN_MASK2;
    167.           }
