apps/prime.c:125: error: BUFFER_OVERRUN_L3
  Offset: [1, +oo] Size: [0, 8388607] by call to `BN_generate_prime_ex`.
Showing all 18 steps of the trace


apps/prime.c:125:14: Call
123.           }
124.           bn = BN_new();
125.           if (!BN_generate_prime_ex(bn, bits, safe, NULL, NULL, NULL)) {
                    ^
126.               BIO_printf(bio_err, "Failed to generate prime.\n");
127.               goto end;

crypto/bn/bn_prime.c:201:1: Parameter `add->top`
  199.   }
  200.   
  201. > int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe,
  202.                            const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb)
  203.   {

crypto/bn/bn_prime.c:241:18: Call
  239.                   goto err;
  240.           } else {
  241.               if (!bn_probable_prime_dh(ret, bits, add, rem, ctx))
                          ^
  242.                   goto err;
  243.           }

crypto/bn/bn_prime.c:576:1: Parameter `add->top`
    574.   }
    575.   
    576. > int bn_probable_prime_dh(BIGNUM *rnd, int bits,
    577.                            const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx)
    578.   {

crypto/bn/bn_prime.c:591:10: Call
    589.       /* we need ((rnd-rem) % add) == 0 */
    590.   
    591.       if (!BN_mod(t1, rnd, add, ctx))
                    ^
    592.           goto err;
    593.       if (!BN_sub(rnd, rnd, t1))

crypto/bn/bn_div.c:253:31: Call
      251.   
      252.       /* First we normalise the numbers */
      253.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
                                           ^
      254.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
      255.           goto err;

crypto/bn/bn_lib.c:215:9: Assignment
        213.   
        214.       if (BN_is_zero(a))
        215.           return 0;
                       ^
        216.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
        217.   }

crypto/bn/bn_div.c:253:5: Assignment
      251.   
      252.       /* First we normalise the numbers */
      253.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
                 ^
      254.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
      255.           goto err;

crypto/bn/bn_div.c:254:11: Call
      252.       /* First we normalise the numbers */
      253.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
      254.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
                       ^
      255.           goto err;
      256.       sdiv->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:1062:1: Parameter `*a->d`
          1060.   }
          1061.   
          1062. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
          1063.   {
          1064.       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 `BN_generate_prime_ex` 
        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.           }
