crypto/bn/bn_x931p.c:91: error: BUFFER_OVERRUN_L3
  Offset: [1, +oo] Size: [0, 8388607] by call to `BN_mod_inverse`.
Showing all 31 steps of the trace


crypto/bn/bn_x931p.c:80:10: Call
78.           goto err;
79.   
80.       if (!bn_x931_derive_pi(p1, Xp1, ctx, cb))
               ^
81.           goto err;
82.   

crypto/bn/bn_x931p.c:25:10: Call
  23.   {
  24.       int i = 0, is_prime;
  25.       if (!BN_copy(pi, Xpi))
                 ^
  26.           return 0;
  27.       if (!BN_is_odd(pi) && !BN_add_word(pi, 1))

crypto/bn/bn_lib.c:281:1: Parameter `a->top`
    279.   }
    280.   
    281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
    282.   {
    283.       bn_check_top(b);

crypto/bn/bn_x931p.c:91:10: Call
89.       /* First set p to value of Rp */
90.   
91.       if (!BN_mod_inverse(p, p2, p1, ctx))
               ^
92.           goto err;
93.   

crypto/bn/bn_gcd.c:124:1: Parameter `n->top`
  122.                                           BN_CTX *ctx);
  123.   
  124. > BIGNUM *BN_mod_inverse(BIGNUM *in,
  125.                          const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
  126.   {

crypto/bn/bn_gcd.c:129:10: Call
  127.       BIGNUM *rv;
  128.       int noinv;
  129.       rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
                  ^
  130.       if (noinv)
  131.           BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE);

crypto/bn/bn_gcd.c:135:1: Parameter `n->top`
    133.   }
    134.   
    135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in,
    136.                              const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx,
    137.                              int *pnoinv)

crypto/bn/bn_gcd.c:144:9: Call
    142.   
    143.       /* This is invalid input so we don't worry about constant time here */
    144.       if (BN_abs_is_word(n, 1) || BN_is_zero(n)) {
                   ^
    145.           if (pnoinv != NULL)
    146.               *pnoinv = 1;

crypto/bn/bn_lib.c:838:1: Parameter `a->top`
      836.   }
      837.   
      838. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
      839.   {
      840.       return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));

crypto/bn/bn_gcd.c:144:33: Call
    142.   
    143.       /* This is invalid input so we don't worry about constant time here */
    144.       if (BN_abs_is_word(n, 1) || BN_is_zero(n)) {
                                           ^
    145.           if (pnoinv != NULL)
    146.               *pnoinv = 1;

crypto/bn/bn_lib.c:843:1: Parameter `a->top`
      841.   }
      842.   
      843. > int BN_is_zero(const BIGNUM *a)
      844.   {
      845.       return a->top == 0;

crypto/bn/bn_gcd.c:155:16: Call
    153.       if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
    154.           || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
    155.           return BN_mod_inverse_no_branch(in, a, n, ctx);
                          ^
    156.       }
    157.   

crypto/bn/bn_gcd.c:458:1: Parameter `n->top`
      456.    * not contain branches that may leak sensitive information.
      457.    */
      458. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
      459.                                           const BIGNUM *a, const BIGNUM *n,
      460.                                           BN_CTX *ctx)

crypto/bn/bn_gcd.c:491:9: Call
      489.       if (BN_copy(B, a) == NULL)
      490.           goto err;
      491.       if (BN_copy(A, n) == NULL)
                     ^
      492.           goto err;
      493.       A->neg = 0;

crypto/bn/bn_lib.c:281:1: Parameter `b->top`
        279.   }
        280.   
        281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
        282.   {
        283.       bn_check_top(b);

crypto/bn/bn_gcd.c:609:18: Call
      607.                   goto err;
      608.           } else {
      609.               if (!BN_nnmod(R, Y, n, ctx))
                              ^
      610.                   goto err;
      611.           }

crypto/bn/bn_mod.c:13:1: Parameter `d->top`
        11.   #include "bn_lcl.h"
        12.   
        13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
        14.   {
        15.       /*

crypto/bn/bn_mod.c:20:11: Call
        18.        */
        19.   
        20.       if (!(BN_mod(r, m, d, ctx)))
                        ^
        21.           return 0;
        22.       if (!r->neg)

crypto/bn/bn_div.c:250:31: Call
          248.   
          249.       /* First we normalise the numbers */
          250.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
                                               ^
          251.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
          252.           goto err;

crypto/bn/bn_lib.c:141:9: Assignment
            139.   
            140.       if (BN_is_zero(a))
            141.           return 0;
                           ^
            142.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
            143.   }

crypto/bn/bn_div.c:250:5: Assignment
          248.   
          249.       /* First we normalise the numbers */
          250.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
                     ^
          251.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
          252.           goto err;

crypto/bn/bn_div.c:251:11: Call
          249.       /* First we normalise the numbers */
          250.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
          251.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
                           ^
          252.           goto err;
          253.       sdiv->neg = 0;

crypto/bn/bn_shift.c:83:1: <Offset trace>
81.   }
82.   
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84.   {
85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:83:1: Parameter `n`
            81.   }
            82.   
            83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
            84.   {
            85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:97:5: Assignment
            95.       }
            96.   
            97.       nw = n / BN_BITS2;
                       ^
            98.       if (bn_wexpand(r, a->top + nw + 1) == NULL)
            99.           return 0;

crypto/bn/bn_shift.c:83:1: <Length trace>
81.   }
82.   
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84.   {
85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:83:1: Parameter `*r->d`
            81.   }
            82.   
            83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
            84.   {
            85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:98:9: Call
            96.   
            97.       nw = n / BN_BITS2;
            98.       if (bn_wexpand(r, a->top + nw + 1) == NULL)
                           ^
            99.           return 0;
            100.       r->neg = a->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_shift.c:104:5: Assignment
            102.       rb = BN_BITS2 - lb;
            103.       f = a->d;
            104.       t = r->d;
                       ^
            105.       t[a->top + nw] = 0;
            106.       if (lb == 0)

crypto/bn/bn_shift.c:112:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_mod_inverse` 
            110.           for (i = a->top - 1; i >= 0; i--) {
            111.               l = f[i];
            112.               t[nw + i + 1] |= (l >> rb) & BN_MASK2;
                               ^
            113.               t[nw + i] = (l << lb) & BN_MASK2;
            114.           }
