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


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:209:1: Parameter `rm->top`
  207.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
  208.    */
  209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
  210.              BN_CTX *ctx)
  211.   {

test/exptest.c:161:13: Call
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))
                   ^
162.           || !TEST_true(BN_mod_exp_recp(r_recp, a, b, m, ctx))
163.           || !TEST_true(BN_mod_exp_simple(r_simple, a, b, m, ctx))

crypto/bn/bn_exp.c:388:14: <Offset trace>
386.           /* 2^(top*BN_BITS2) - m */
387.           r->d[0] = (0 - m->d[0]) & BN_MASK2;
388.           for (i = 1; i < j; i++)
                    ^
389.               r->d[i] = (~m->d[i]) & BN_MASK2;
390.           r->top = j;

crypto/bn/bn_exp.c:388:14: Assignment
  386.           /* 2^(top*BN_BITS2) - m */
  387.           r->d[0] = (0 - m->d[0]) & BN_MASK2;
  388.           for (i = 1; i < j; i++)
                      ^
  389.               r->d[i] = (~m->d[i]) & BN_MASK2;
  390.           r->top = j;

crypto/bn/bn_exp.c:296:1: <Length trace>
294.   }
295.   
296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
297.                       const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
298.   {

crypto/bn/bn_exp.c:296:1: Parameter `*m->d`
  294.   }
  295.   
  296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
  297.                       const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
  298.   {

crypto/bn/bn_exp.c:389:25: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_mod_exp_mont` 
  387.           r->d[0] = (0 - m->d[0]) & BN_MASK2;
  388.           for (i = 1; i < j; i++)
  389.               r->d[i] = (~m->d[i]) & BN_MASK2;
                                 ^
  390.           r->top = j;
  391.           r->flags |= BN_FLG_FIXED_TOP;
