apps/gendsa.c:174: error: BUFFER_OVERRUN_L3
  Offset: [1, +oo] Size: [0, 8388607] by call to `DSA_generate_key`.
Showing all 25 steps of the trace


apps/gendsa.c:173:58: Call
171.   
172.       DSA_get0_pqg(dsa, &p, NULL, NULL);
173.       BIO_printf(bio_err, "Generating DSA key, %d bits\n", BN_num_bits(p));
                                                                ^
174.       if (!DSA_generate_key(dsa))
175.           goto end;

crypto/bn/bn_lib.c:219:9: Call
  217.       bn_check_top(a);
  218.   
  219.       if (BN_is_zero(a))
                 ^
  220.           return 0;
  221.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:971:1: Parameter `a->top`
    969.   }
    970.   
    971. > int BN_is_zero(const BIGNUM *a)
    972.   {
    973.       return a->top == 0;

apps/gendsa.c:174:10: Call
172.       DSA_get0_pqg(dsa, &p, NULL, NULL);
173.       BIO_printf(bio_err, "Generating DSA key, %d bits\n", BN_num_bits(p));
174.       if (!DSA_generate_key(dsa))
                ^
175.           goto end;
176.   

crypto/dsa/dsa_key.c:67:1: Parameter `dsa->g->top`
  65.   static int dsa_builtin_keygen(DSA *dsa);
  66.   
  67. > int DSA_generate_key(DSA *dsa)
  68.   {
  69.       if (dsa->meth->dsa_keygen)

crypto/dsa/dsa_key.c:71:12: Call
  69.       if (dsa->meth->dsa_keygen)
  70.           return dsa->meth->dsa_keygen(dsa);
  71.       return dsa_builtin_keygen(dsa);
                   ^
  72.   }
  73.   

crypto/dsa/dsa_key.c:74:1: Parameter `dsa->g->top`
    72.   }
    73.   
    74. > static int dsa_builtin_keygen(DSA *dsa)
    75.   {
    76.       int ok = 0;

crypto/dsa/dsa_key.c:113:14: Call
    111.           }
    112.   
    113.           if (!BN_mod_exp(pub_key, dsa->g, prk, dsa->p, ctx)) {
                        ^
    114.               BN_free(local_prk);
    115.               goto err;

crypto/bn/bn_exp.c:191:1: Parameter `a->top`
      189.   }
      190.   
      191. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
      192.                  BN_CTX *ctx)
      193.   {

crypto/bn/bn_exp.c:251:19: Call
      249.           } else
      250.   # endif
      251.               ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL);
                               ^
      252.       } else
      253.   #endif

crypto/bn/bn_exp.c:401:1: Parameter `a->top`
        399.   }
        400.   
        401. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
        402.                       const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
        403.   {

crypto/bn/bn_exp.c:413:16: Call
        411.   
        412.       if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) {
        413.           return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
                              ^
        414.       }
        415.   

crypto/bn/bn_exp.c:693:1: Parameter `a->top`
          691.    * http://www.daemonology.net/hyperthreading-considered-harmful/)
          692.    */
          693. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
          694.                                 const BIGNUM *m, BN_CTX *ctx,
          695.                                 BN_MONT_CTX *in_mont)

crypto/bn/bn_exp.c:846:14: Call
          844.       /* prepare a^1 in Montgomery domain */
          845.       if (a->neg || BN_ucmp(a, m) >= 0) {
          846.           if (!BN_mod(&am, a, m, ctx))
                              ^
          847.               goto err;
          848.           if (!BN_to_montgomery(&am, &am, mont, ctx))

crypto/bn/bn_div.c:188:1: Parameter `num->top`
            186.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
            187.    */
            188. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
            189.              BN_CTX *ctx)
            190.   {

crypto/bn/bn_div.c:258:11: Call
            256.       sdiv->neg = 0;
            257.       norm_shift += BN_BITS2;
            258.       if (!(BN_lshift(snum, num, norm_shift)))
                             ^
            259.           goto err;
            260.       snum->neg = 0;

crypto/bn/bn_shift.c:129:1: <Offset trace>
127.   }
128.   
129. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
130.   {
131.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:129:1: Parameter `n`
              127.   }
              128.   
              129. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
              130.   {
              131.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:144:5: Assignment
              142.   
              143.       r->neg = a->neg;
              144.       nw = n / BN_BITS2;
                         ^
              145.       if (bn_wexpand(r, a->top + nw + 1) == NULL)
              146.           return (0);

crypto/bn/bn_shift.c:129:1: <Length trace>
127.   }
128.   
129. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
130.   {
131.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:129:1: Parameter `*r->d`
              127.   }
              128.   
              129. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
              130.   {
              131.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:145:9: Call
              143.       r->neg = a->neg;
              144.       nw = n / BN_BITS2;
              145.       if (bn_wexpand(r, a->top + nw + 1) == NULL)
                             ^
              146.           return (0);
              147.       lb = n % BN_BITS2;

crypto/bn/bn_lib.c:1067:1: Parameter `*a->d`
                1065.   }
                1066.   
                1067. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
                1068.   {
                1069.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_shift.c:150:5: Assignment
              148.       rb = BN_BITS2 - lb;
              149.       f = a->d;
              150.       t = r->d;
                         ^
              151.       t[a->top + nw] = 0;
              152.       if (lb == 0)

crypto/bn/bn_shift.c:158:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `DSA_generate_key` 
              156.           for (i = a->top - 1; i >= 0; i--) {
              157.               l = f[i];
              158.               t[nw + i + 1] |= (l >> rb) & BN_MASK2;
                                 ^
              159.               t[nw + i] = (l << lb) & BN_MASK2;
              160.           }
