crypto/rsa/rsa_chk.c:184: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_inverse`.
Showing all 27 steps of the trace


crypto/rsa/rsa_chk.c:19:1: Parameter `key->q->top`
17.   }
18.   
19. > int RSA_check_key_ex(const RSA *key, BN_GENCB *cb)
20.   {
21.       BIGNUM *i, *j, *k, *l, *m;

crypto/rsa/rsa_chk.c:71:9: Call
69.   
70.       /* q prime? */
71.       if (BN_is_prime_ex(key->q, BN_prime_checks, NULL, cb) != 1) {
              ^
72.           ret = 0;
73.           RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_Q_NOT_PRIME);

crypto/bn/bn_prime.c:145:1: Parameter `a->top`
  143.   }
  144.   
  145. > int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
  146.                      BN_GENCB *cb)
  147.   {

crypto/bn/bn_prime.c:148:12: Call
  146.                      BN_GENCB *cb)
  147.   {
  148.       return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb);
                    ^
  149.   }
  150.   

crypto/bn/bn_prime.c:151:1: Parameter `a->top`
    149.   }
    150.   
    151. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
    152.                               int do_trial_division, BN_GENCB *cb)
    153.   {

crypto/bn/bn_prime.c:161:9: Call
    159.   
    160.       /* Take care of the really small primes 2 & 3 */
    161.       if (BN_is_word(a, 2) || BN_is_word(a, 3))
                   ^
    162.           return 1;
    163.   

crypto/bn/bn_lib.c:856:1: Parameter `a->top`
      854.   }
      855.   
      856. > int BN_is_word(const BIGNUM *a, const BN_ULONG w)
      857.   {
      858.       return BN_abs_is_word(a, w) && (!w || !a->neg);

crypto/bn/bn_lib.c:858:12: Call
      856.   int BN_is_word(const BIGNUM *a, const BN_ULONG w)
      857.   {
      858.       return BN_abs_is_word(a, w) && (!w || !a->neg);
                        ^
      859.   }
      860.   

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

crypto/rsa/rsa_chk.c:111:10: Call
109.           goto err;
110.       }
111.       if (!BN_sub(j, key->q, BN_value_one())) {
                ^
112.           ret = -1;
113.           goto err;

crypto/bn/bn_add.c:45:1: Parameter `a->top`
  43.   
  44.   /* signed sub of b from a. */
  45. > int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
  46.   {
  47.       int ret, r_neg, cmp_res;

crypto/rsa/rsa_chk.c:170:14: Call
168.   
169.           /* dmq1 = d mod (q-1)? */
170.           if (!BN_sub(i, key->q, BN_value_one())) {
                    ^
171.               ret = -1;
172.               goto err;

crypto/bn/bn_add.c:45:1: Parameter `a->top`
  43.   
  44.   /* signed sub of b from a. */
  45. > int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
  46.   {
  47.       int ret, r_neg, cmp_res;

crypto/rsa/rsa_chk.c:184:14: Call
182.   
183.           /* iqmp = q^-1 mod p? */
184.           if (!BN_mod_inverse(i, key->q, key->p, ctx)) {
                    ^
185.               ret = -1;
186.               goto err;

crypto/bn/bn_gcd.c:124:1: Parameter `a->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 `a->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: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 `a->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:489:9: Call
      487.       BN_one(X);
      488.       BN_zero(Y);
      489.       if (BN_copy(B, a) == NULL)
                     ^
      490.           goto err;
      491.       if (BN_copy(A, n) == NULL)

crypto/bn/bn_lib.c:280:1: <Offset trace>
278.   }
279.   
280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
281.   {
282.       bn_check_top(b);

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

crypto/bn/bn_lib.c:280:1: <Length trace>
278.   }
279.   
280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
281.   {
282.       bn_check_top(b);

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

crypto/bn/bn_lib.c:286:9: Call
        284.       if (a == b)
        285.           return a;
        286.       if (bn_wexpand(a, b->top) == NULL)
                       ^
        287.           return NULL;
        288.   

crypto/bn/bn_lib.c:942:1: Parameter `*a->d`
          940.   }
          941.   
          942. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
          943.   {
          944.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_lib.c:290:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_inverse` 
        288.   
        289.       if (b->top > 0)
        290.           memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
                       ^
        291.   
        292.       a->neg = b->neg;
