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


apps/dsaparam.c:264:19: Call
262.   
263.       if (C) {
264.           int len = BN_num_bytes(dsa->p);
                         ^
265.           int bits_p = BN_num_bits(dsa->p);
266.           unsigned char *data = app_malloc(len + 20, "BN space");

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

crypto/bn/bn_lib.c:899:1: Parameter `a->top`
    897.   }
    898.   
    899. > int BN_is_zero(const BIGNUM *a)
    900.   {
    901.       return a->top == 0;

apps/dsaparam.c:265:22: Call
263.       if (C) {
264.           int len = BN_num_bytes(dsa->p);
265.           int bits_p = BN_num_bits(dsa->p);
                            ^
266.           unsigned char *data = app_malloc(len + 20, "BN space");
267.   

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

crypto/bn/bn_lib.c:899:1: Parameter `a->top`
    897.   }
    898.   
    899. > int BN_is_zero(const BIGNUM *a)
    900.   {
    901.       return a->top == 0;

apps/dsaparam.c:269:9: Call
267.   
268.           BIO_printf(bio_out, "DSA *get_dsa%d()\n{\n", bits_p);
269.           print_bignum_var(bio_out, dsa->p, "dsap", len, data);
               ^
270.           print_bignum_var(bio_out, dsa->q, "dsaq", len, data);
271.           print_bignum_var(bio_out, dsa->g, "dsag", len, data);

apps/apps.c:1217:9: Call
  1215.   {
  1216.       BIO_printf(out, "    static unsigned char %s_%d[] = {", var, len);
  1217.       if (BN_is_zero(in))
                  ^
  1218.           BIO_printf(out, "\n\t0x00");
  1219.       else {

crypto/bn/bn_lib.c:899:1: Parameter `a->top`
    897.   }
    898.   
    899. > int BN_is_zero(const BIGNUM *a)
    900.   {
    901.       return a->top == 0;

apps/dsaparam.c:270:9: Call
268.           BIO_printf(bio_out, "DSA *get_dsa%d()\n{\n", bits_p);
269.           print_bignum_var(bio_out, dsa->p, "dsap", len, data);
270.           print_bignum_var(bio_out, dsa->q, "dsaq", len, data);
               ^
271.           print_bignum_var(bio_out, dsa->g, "dsag", len, data);
272.           BIO_printf(bio_out, "    DSA *dsa = DSA_new();\n"

apps/apps.c:1217:9: Call
  1215.   {
  1216.       BIO_printf(out, "    static unsigned char %s_%d[] = {", var, len);
  1217.       if (BN_is_zero(in))
                  ^
  1218.           BIO_printf(out, "\n\t0x00");
  1219.       else {

crypto/bn/bn_lib.c:899:1: Parameter `a->top`
    897.   }
    898.   
    899. > int BN_is_zero(const BIGNUM *a)
    900.   {
    901.       return a->top == 0;

apps/dsaparam.c:271:9: Call
269.           print_bignum_var(bio_out, dsa->p, "dsap", len, data);
270.           print_bignum_var(bio_out, dsa->q, "dsaq", len, data);
271.           print_bignum_var(bio_out, dsa->g, "dsag", len, data);
               ^
272.           BIO_printf(bio_out, "    DSA *dsa = DSA_new();\n"
273.                               "\n");

apps/apps.c:1217:9: Call
  1215.   {
  1216.       BIO_printf(out, "    static unsigned char %s_%d[] = {", var, len);
  1217.       if (BN_is_zero(in))
                  ^
  1218.           BIO_printf(out, "\n\t0x00");
  1219.       else {

crypto/bn/bn_lib.c:899:1: Parameter `a->top`
    897.   }
    898.   
    899. > int BN_is_zero(const BIGNUM *a)
    900.   {
    901.       return a->top == 0;

apps/dsaparam.c:306:14: Call
304.           if ((dsakey = DSAparams_dup(dsa)) == NULL)
305.               goto end;
306.           if (!DSA_generate_key(dsakey)) {
                    ^
307.               ERR_print_errors(bio_err);
308.               DSA_free(dsakey);

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

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

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

crypto/dsa/dsa_key.c:114:14: Call
    112.           }
    113.   
    114.           if (!BN_mod_exp(pub_key, dsa->g, prk, dsa->p, ctx)) {
                        ^
    115.               BN_free(local_prk);
    116.               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:655:1: Parameter `a->top`
          653.    * http://www.daemonology.net/hyperthreading-considered-harmful/)
          654.    */
          655. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
          656.                                 const BIGNUM *m, BN_CTX *ctx,
          657.                                 BN_MONT_CTX *in_mont)

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

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

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

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

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

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

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

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

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

crypto/bn/bn_lib.c:995:1: Parameter `*a->d`
                993.   }
                994.   
                995. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
                996.   {
                997.       return (words <= a->dmax) ? a : bn_expand2(a, words);

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

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