crypto/dsa/dsa_ossl.c:230: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_inverse`.
Showing all 28 steps of the trace


crypto/dsa/dsa_ossl.c:143:1: Parameter `dsa->q->top`
141.   }
142.   
143. > static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
144.                             BIGNUM **kinvp, BIGNUM **rp,
145.                             const unsigned char *dgst, int dlen)

crypto/dsa/dsa_ossl.c:171:14: Call
169.   
170.       /* Preallocate space */
171.       q_bits = BN_num_bits(dsa->q);
                    ^
172.       if (!BN_set_bit(k, q_bits)
173.           || !BN_set_bit(l, q_bits)

crypto/bn/bn_lib.c:139:9: Call
  137.       bn_check_top(a);
  138.   
  139.       if (BN_is_zero(a))
                 ^
  140.           return 0;
  141.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:814:1: Parameter `a->top`
    812.   }
    813.   
    814. > int BN_is_zero(const BIGNUM *a)
    815.   {
    816.       return a->top == 0;

crypto/dsa/dsa_ossl.c:187:21: Call
185.                                          dlen, ctx))
186.                   goto err;
187.           } else if (!BN_priv_rand_range(k, dsa->q))
                           ^
188.               goto err;
189.       } while (BN_is_zero(k));

crypto/bn/bn_rand.c:182:1: Parameter `range->top`
  180.   }
  181.   
  182. > int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range)
  183.   {
  184.       return bnrand_range(PRIVATE, r, range);

crypto/bn/bn_rand.c:184:12: Call
  182.   int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range)
  183.   {
  184.       return bnrand_range(PRIVATE, r, range);
                    ^
  185.   }
  186.   

crypto/bn/bn_rand.c:113:1: Parameter `range->top`
    111.   
    112.   /* random number r:  0 <= r < range */
    113. > static int bnrand_range(BNRAND_FLAG flag, BIGNUM *r, const BIGNUM *range)
    114.   {
    115.       int n;

crypto/dsa/dsa_ossl.c:212:10: Call
210.        * conditional copy.
211.        */
212.       if (!BN_add(l, k, dsa->q)
                ^
213.           || !BN_add(m, l, dsa->q)
214.           || !BN_copy(k, BN_num_bits(l) > q_bits ? l : m))

crypto/bn/bn_add.c:14:1: Parameter `b->top`
  12.   
  13.   /* signed add of b to a. */
  14. > int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
  15.   {
  16.       int ret, r_neg, cmp_res;

crypto/dsa/dsa_ossl.c:213:13: Call
211.        */
212.       if (!BN_add(l, k, dsa->q)
213.           || !BN_add(m, l, dsa->q)
                   ^
214.           || !BN_copy(k, BN_num_bits(l) > q_bits ? l : m))
215.           goto err;

crypto/bn/bn_add.c:14:1: Parameter `b->top`
  12.   
  13.   /* signed add of b to a. */
  14. > int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
  15.   {
  16.       int ret, r_neg, cmp_res;

crypto/dsa/dsa_ossl.c:226:10: Call
224.       }
225.   
226.       if (!BN_mod(r, r, dsa->q, ctx))
                ^
227.           goto err;
228.   

crypto/bn/bn_div.c:137:1: Parameter `divisor->top`
  135.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
  136.    */
  137. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
  138.              BN_CTX *ctx)
  139.   {

crypto/dsa/dsa_ossl.c:230:17: Call
228.   
229.       /* Compute  part of 's = inv(k) (m + xr) mod q' */
230.       if ((kinv = BN_mod_inverse(NULL, k, dsa->q, ctx)) == NULL)
                       ^
231.           goto err;
232.   

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:148:16: Call
    146.       if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
    147.           || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
    148.           return BN_mod_inverse_no_branch(in, a, n, ctx);
                          ^
    149.       }
    150.   

crypto/bn/bn_gcd.c:451:1: Parameter `n->top`
      449.    * not contain branches that may leak sensitive information.
      450.    */
      451. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
      452.                                           const BIGNUM *a, const BIGNUM *n,
      453.                                           BN_CTX *ctx)

crypto/bn/bn_gcd.c:484:9: Call
      482.       if (BN_copy(B, a) == NULL)
      483.           goto err;
      484.       if (BN_copy(A, n) == NULL)
                     ^
      485.           goto err;
      486.       A->neg = 0;

crypto/bn/bn_lib.c:285:1: <Offset trace>
283.   }
284.   
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286.   {
287.       bn_check_top(b);

crypto/bn/bn_lib.c:285:1: Parameter `b->top`
        283.   }
        284.   
        285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
        286.   {
        287.       bn_check_top(b);

crypto/bn/bn_lib.c:285:1: <Length trace>
283.   }
284.   
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286.   {
287.       bn_check_top(b);

crypto/bn/bn_lib.c:285:1: Parameter `*a->d`
        283.   }
        284.   
        285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
        286.   {
        287.       bn_check_top(b);

crypto/bn/bn_lib.c:291:9: Call
        289.       if (a == b)
        290.           return a;
        291.       if (bn_wexpand(a, b->top) == NULL)
                       ^
        292.           return NULL;
        293.   

crypto/bn/bn_lib.c:910:1: Parameter `*a->d`
          908.   }
          909.   
          910. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
          911.   {
          912.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_lib.c:295:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_inverse` 
        293.   
        294.       if (b->top > 0)
        295.           memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
                       ^
        296.   
        297.       a->top = b->top;
