test/bntest.c:406: error: BUFFER_OVERRUN_L3
  Offset: [8, +oo] (⇐ [8, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mod_exp_mont_consttime`.
Showing all 23 steps of the trace


test/bntest.c:402:5: Call
400.           goto err;
401.   
402.       BN_bntest_rand(m, 1024, 0, 1); /* must be odd for montgomery */
           ^
403.       /* Zero exponent */
404.       BN_bntest_rand(a, 1024, 0, 0);

crypto/bn/bn_rand.c:102:1: Parameter `*rnd->d`
  100.   }
  101.   
  102. > int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
  103.   {
  104.       return bnrand(TESTING, rnd, bits, top, bottom);

crypto/bn/bn_rand.c:104:12: Call
  102.   int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
  103.   {
  104.       return bnrand(TESTING, rnd, bits, top, bottom);
                    ^
  105.   }
  106.   

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/bntest.c:406:10: Call
404.       BN_bntest_rand(a, 1024, 0, 0);
405.       BN_zero(p);
406.       if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)))
                ^
407.           goto err;
408.       if (!TEST_BN_eq_one(d))

crypto/bn/bn_exp.c:592:1: Parameter `*a->d`
  590.    * http://www.daemonology.net/hyperthreading-considered-harmful/)
  591.    */
  592. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
  593.                                 const BIGNUM *m, BN_CTX *ctx,
  594.                                 BN_MONT_CTX *in_mont)

crypto/bn/bn_exp.c:757:10: Call
  755.   
  756.       /* prepare a^1 in Montgomery domain */
  757.       if (!bn_to_mont_fixed_top(&am, a, mont, ctx))
                  ^
  758.           goto err;
  759.   

crypto/bn/bn_mont.c:222:1: Parameter `*a->d`
    220.   }
    221.   
    222. > int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
    223.                            BN_CTX *ctx)
    224.   {

crypto/bn/bn_mont.c:225:12: Call
    223.                            BN_CTX *ctx)
    224.   {
    225.       return bn_mul_mont_fixed_top(r, a, &(mont->RR), mont, ctx);
                      ^
    226.   }
    227.   

crypto/bn/bn_mont.c:37:1: Parameter `*a->d`
      35.   }
      36.   
      37. > int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
      38.                             BN_MONT_CTX *mont, BN_CTX *ctx)
      39.   {

crypto/bn/bn_mont.c:70:14: Call
      68.               goto err;
      69.       } else {
      70.           if (!bn_mul_fixed_top(tmp, a, b, ctx))
                         ^
      71.               goto err;
      72.       }

crypto/bn/bn_mul.c:507:1: Parameter `*a->d`
        505.   }
        506.   
        507. > int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
        508.   {
        509.       int ret = 0;

crypto/bn/bn_mul.c:587:17: Call
        585.                   if (bn_wexpand(rr, k * 4) == NULL)
        586.                       goto err;
        587.                   bn_mul_part_recursive(rr->d, a->d, b->d,
                               ^
        588.                                         j, al - j, bl - j, t->d);
        589.               } 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:720:1: Parameter `cl`
            718.    */
            719.   
            720. > int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b, int cl, int dl)
            721.   {
            722.       int n, i;

crypto/bn/bn_lib.c:737:12: Call
            735.           }
            736.       }
            737.       return bn_cmp_words(a, b, cl);
                              ^
            738.   }
            739.   

crypto/bn/bn_lib.c:693:1: <Offset trace>
691.   }
692.   
693. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
694.   {
695.       int i;

crypto/bn/bn_lib.c:693:1: Parameter `n`
              691.   }
              692.   
              693. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
              694.   {
              695.       int i;

crypto/bn/bn_lib.c:702:10: Assignment
              700.       if (aa != bb)
              701.           return ((aa > bb) ? 1 : -1);
              702.       for (i = n - 2; i >= 0; i--) {
                              ^
              703.           aa = a[i];
              704.           bb = b[i];

crypto/bn/bn_lib.c:693:1: <Length trace>
691.   }
692.   
693. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
694.   {
695.       int i;

crypto/bn/bn_lib.c:693:1: Parameter `*b`
              691.   }
              692.   
              693. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
              694.   {
              695.       int i;

crypto/bn/bn_lib.c:704:14: Array access: Offset: [8, +oo] (⇐ [8, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mod_exp_mont_consttime` 
              702.       for (i = n - 2; i >= 0; i--) {
              703.           aa = a[i];
              704.           bb = b[i];
                                  ^
              705.           if (aa != bb)
              706.               return ((aa > bb) ? 1 : -1);
