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


test/exptest.c:60:5: Call
58.           goto err;
59.   
60.       BN_one(m);
          ^
61.       BN_one(a);
62.       BN_zero(p);

crypto/bn/bn_lib.c:366:15: Assignment
  364.       a->neg = 0;
  365.       a->d[0] = w;
  366.       a->top = (w ? 1 : 0);
                       ^
  367.       a->flags &= ~BN_FLG_FIXED_TOP;
  368.       bn_check_top(a);

crypto/bn/bn_lib.c:366:5: Assignment
  364.       a->neg = 0;
  365.       a->d[0] = w;
  366.       a->top = (w ? 1 : 0);
             ^
  367.       a->flags &= ~BN_FLG_FIXED_TOP;
  368.       bn_check_top(a);

test/exptest.c:67:10: Call
65.           goto err;
66.   
67.       if (!TEST_true(BN_mod_exp(r, a, p, m, ctx)))
               ^
68.           goto err;
69.   

crypto/bn/bn_exp.c:89:1: Parameter `*m->d`
  87.   }
  88.   
  89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
  90.                  BN_CTX *ctx)
  91.   {

crypto/bn/bn_exp.c:144:19: Call
  142.           } else
  143.   # endif
  144.               ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL);
                           ^
  145.       } else
  146.   #endif

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` 
    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;
