test/exptest.c:161: error: BUFFER_OVERRUN_L3
  Offset: [8, +oo] (⇐ [8, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mod_exp_mont`.
Showing all 25 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: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:296:1: Parameter `*a->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:310:16: Call
  308.               || BN_get_flags(a, BN_FLG_CONSTTIME) != 0
  309.               || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) {
  310.           return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
                        ^
  311.       }
  312.   

crypto/bn/bn_exp.c:598:1: Parameter `*a->d`
    596.    * http://www.daemonology.net/hyperthreading-considered-harmful/)
    597.    */
    598. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
    599.                                 const BIGNUM *m, BN_CTX *ctx,
    600.                                 BN_MONT_CTX *in_mont)

crypto/bn/bn_exp.c:755:17: Call
    753.           if (!BN_to_montgomery(&am, &am, mont, ctx))
    754.               goto err;
    755.       } else if (!BN_to_montgomery(&am, a, mont, ctx))
                           ^
    756.           goto err;
    757.   

crypto/bn/bn_lib.c:869:1: Parameter `*a->d`
      867.   }
      868.   
      869. > int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
      870.                        BN_CTX *ctx)
      871.   {

crypto/bn/bn_lib.c:872:12: Call
      870.                        BN_CTX *ctx)
      871.   {
      872.       return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx);
                        ^
      873.   }
      874.   

crypto/bn/bn_mont.c:26:1: Parameter `*a->d`
        24.   #endif
        25.   
        26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
        27.                             BN_MONT_CTX *mont, BN_CTX *ctx)
        28.   {

crypto/bn/bn_mont.c:56:14: Call
        54.               goto err;
        55.       } else {
        56.           if (!BN_mul(tmp, a, b, ctx))
                           ^
        57.               goto err;
        58.       }

crypto/bn/bn_mul.c:497:1: Parameter `*a->d`
          495.   #endif                          /* BN_RECURSION */
          496.   
          497. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
          498.   {
          499.       int ret = 0;

crypto/bn/bn_mul.c:577:17: Call
          575.                   if (bn_wexpand(rr, k * 4) == NULL)
          576.                       goto err;
          577.                   bn_mul_part_recursive(rr->d, a->d, b->d,
                                 ^
          578.                                         j, al - j, bl - j, t->d);
          579.               } else {            /* al <= j || bl <= j */

crypto/bn/bn_mul.c:322:1: Parameter `n`
            320.    */
            321.   /* tnX may not be negative but less than n */
            322. > void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
            323.                              int tna, int tnb, BN_ULONG *t)
            324.   {

crypto/bn/bn_mul.c:335:10: Call
            333.   
            334.       /* r=(a[0]-a[1])*(b[1]-b[0]) */
            335.       c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna);
                            ^
            336.       c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n);
            337.       neg = 0;

crypto/bn/bn_lib.c:727:1: Parameter `cl`
              725.    */
              726.   
              727. > int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b, int cl, int dl)
              728.   {
              729.       int n, i;

crypto/bn/bn_lib.c:744:12: Call
              742.           }
              743.       }
              744.       return bn_cmp_words(a, b, cl);
                                ^
              745.   }
              746.   

crypto/bn/bn_lib.c:700:1: <Offset trace>
698.   }
699.   
700. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
701.   {
702.       int i;

crypto/bn/bn_lib.c:700:1: Parameter `n`
                698.   }
                699.   
                700. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
                701.   {
                702.       int i;

crypto/bn/bn_lib.c:709:10: Assignment
                707.       if (aa != bb)
                708.           return ((aa > bb) ? 1 : -1);
                709.       for (i = n - 2; i >= 0; i--) {
                                ^
                710.           aa = a[i];
                711.           bb = b[i];

crypto/bn/bn_lib.c:700:1: <Length trace>
698.   }
699.   
700. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
701.   {
702.       int i;

crypto/bn/bn_lib.c:700:1: Parameter `*b`
                698.   }
                699.   
                700. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
                701.   {
                702.       int i;

crypto/bn/bn_lib.c:711:14: Array access: Offset: [8, +oo] (⇐ [8, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mod_exp_mont` 
                709.       for (i = n - 2; i >= 0; i--) {
                710.           aa = a[i];
                711.           bb = b[i];
                                    ^
                712.           if (aa != bb)
                713.               return ((aa > bb) ? 1 : -1);
