apps/dsaparam.c:235: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 536870848] by call to `DSA_generate_key`.
Showing all 33 steps of the trace


apps/dsaparam.c:186:15: Call
184.   
185.           DSA_get0_pqg(dsa, &p, &q, &g);
186.           len = BN_num_bytes(p);
                     ^
187.           bits_p = BN_num_bits(p);
188.   

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

crypto/bn/bn_lib.c:866:1: Parameter `a->top`
    864.   }
    865.   
    866. > int BN_is_zero(const BIGNUM *a)
    867.   {
    868.       return a->top == 0;

apps/dsaparam.c:187:18: Call
185.           DSA_get0_pqg(dsa, &p, &q, &g);
186.           len = BN_num_bytes(p);
187.           bits_p = BN_num_bits(p);
                        ^
188.   
189.           data = app_malloc(len + 20, "BN space");

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

crypto/bn/bn_lib.c:866:1: Parameter `a->top`
    864.   }
    865.   
    866. > int BN_is_zero(const BIGNUM *a)
    867.   {
    868.       return a->top == 0;

apps/dsaparam.c:192:9: Call
190.   
191.           BIO_printf(bio_out, "static DSA *get_dsa%d(void)\n{\n", bits_p);
192.           print_bignum_var(bio_out, p, "dsap", bits_p, data);
               ^
193.           print_bignum_var(bio_out, q, "dsaq", bits_p, data);
194.           print_bignum_var(bio_out, g, "dsag", bits_p, data);

apps/apps.c:1031:9: Call
  1029.   {
  1030.       BIO_printf(out, "    static unsigned char %s_%d[] = {", var, len);
  1031.       if (BN_is_zero(in)) {
                  ^
  1032.           BIO_printf(out, "\n        0x00");
  1033.       } else {

crypto/bn/bn_lib.c:866:1: Parameter `a->top`
    864.   }
    865.   
    866. > int BN_is_zero(const BIGNUM *a)
    867.   {
    868.       return a->top == 0;

apps/dsaparam.c:193:9: Call
191.           BIO_printf(bio_out, "static DSA *get_dsa%d(void)\n{\n", bits_p);
192.           print_bignum_var(bio_out, p, "dsap", bits_p, data);
193.           print_bignum_var(bio_out, q, "dsaq", bits_p, data);
               ^
194.           print_bignum_var(bio_out, g, "dsag", bits_p, data);
195.           BIO_printf(bio_out, "    DSA *dsa = DSA_new();\n"

apps/apps.c:1031:9: Call
  1029.   {
  1030.       BIO_printf(out, "    static unsigned char %s_%d[] = {", var, len);
  1031.       if (BN_is_zero(in)) {
                  ^
  1032.           BIO_printf(out, "\n        0x00");
  1033.       } else {

crypto/bn/bn_lib.c:866:1: Parameter `a->top`
    864.   }
    865.   
    866. > int BN_is_zero(const BIGNUM *a)
    867.   {
    868.       return a->top == 0;

apps/dsaparam.c:194:9: Call
192.           print_bignum_var(bio_out, p, "dsap", bits_p, data);
193.           print_bignum_var(bio_out, q, "dsaq", bits_p, data);
194.           print_bignum_var(bio_out, g, "dsag", bits_p, data);
               ^
195.           BIO_printf(bio_out, "    DSA *dsa = DSA_new();\n"
196.                               "    BIGNUM *p, *q, *g;\n"

apps/apps.c:1031:9: Call
  1029.   {
  1030.       BIO_printf(out, "    static unsigned char %s_%d[] = {", var, len);
  1031.       if (BN_is_zero(in)) {
                  ^
  1032.           BIO_printf(out, "\n        0x00");
  1033.       } else {

crypto/bn/bn_lib.c:866:1: Parameter `a->top`
    864.   }
    865.   
    866. > int BN_is_zero(const BIGNUM *a)
    867.   {
    868.       return a->top == 0;

apps/dsaparam.c:235:14: Call
233.           if ((dsakey = DSAparams_dup(dsa)) == NULL)
234.               goto end;
235.           if (!DSA_generate_key(dsakey)) {
                    ^
236.               ERR_print_errors(bio_err);
237.               DSA_free(dsakey);

crypto/dsa/dsa_key.c:18:1: Parameter `dsa->p->top`
  16.   static int dsa_builtin_keygen(DSA *dsa);
  17.   
  18. > int DSA_generate_key(DSA *dsa)
  19.   {
  20.       if (dsa->meth->dsa_keygen)

crypto/dsa/dsa_key.c:22:12: Call
  20.       if (dsa->meth->dsa_keygen)
  21.           return dsa->meth->dsa_keygen(dsa);
  22.       return dsa_builtin_keygen(dsa);
                   ^
  23.   }
  24.   

crypto/dsa/dsa_key.c:25:1: Parameter `dsa->p->top`
    23.   }
    24.   
    25. > static int dsa_builtin_keygen(DSA *dsa)
    26.   {
    27.       int ok = 0;

crypto/dsa/dsa_key.c:58:14: Call
    56.           BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME);
    57.   
    58.           if (!BN_mod_exp(pub_key, dsa->g, prk, dsa->p, ctx)) {
                       ^
    59.               BN_free(prk);
    60.               goto err;

crypto/bn/bn_exp.c:89:1: Parameter `m->top`
      87.   }
      88.   
      89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
      90.                  BN_CTX *ctx)
      91.   {

crypto/bn/bn_exp.c:134:9: Call
      132.   
      133.   #ifdef MONT_MUL_MOD
      134.       if (BN_is_odd(m)) {
                     ^
      135.   # ifdef MONT_EXP_WORD
      136.           if (a->top == 1 && !a->neg

crypto/bn/bn_lib.c:881:1: Parameter `a->top`
        879.   }
        880.   
        881. > int BN_is_odd(const BIGNUM *a)
        882.   {
        883.       return (a->top > 0) && (a->d[0] & 1);

crypto/bn/bn_exp.c:149:15: Call
      147.   #ifdef RECP_MUL_MOD
      148.       {
      149.           ret = BN_mod_exp_recp(r, a, p, m, ctx);
                           ^
      150.       }
      151.   #else

crypto/bn/bn_exp.c:161:1: Parameter `m->top`
        159.   }
        160.   
        161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
        162.                       const BIGNUM *m, BN_CTX *ctx)
        163.   {

crypto/bn/bn_exp.c:200:14: Call
        198.       if (m->neg) {
        199.           /* ignore sign of 'm' */
        200.           if (!BN_copy(aa, m))
                            ^
        201.               goto err;
        202.           aa->neg = 0;

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

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_lib.c:281:1: <Length trace>
279.   }
280.   
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282.   {
283.       bn_check_top(b);

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

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

crypto/bn/bn_lib.c:962:1: Parameter `*a->d`
            960.   }
            961.   
            962. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
            963.   {
            964.       return (words <= a->dmax) ? a : bn_expand2(a, words);

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