crypto/dh/dh_key.c:158: error: BUFFER_OVERRUN_L3
  Offset: 0 Size: [0, 8388607] by call to `BN_rand`.
Showing all 11 steps of the trace


crypto/dh/dh_key.c:113:1: Parameter `dh->priv_key->d`
111.   }
112.   
113. > static int generate_key(DH *dh)
114.   {
115.       int ok = 0;

crypto/dh/dh_key.c:158:18: Call
156.               /* secret exponent length */
157.               l = dh->length ? dh->length : BN_num_bits(dh->p) - 1;
158.               if (!BN_rand(priv_key, l, 0, 0))
                        ^
159.                   goto err;
160.           }

crypto/bn/bn_rand.c:199:1: Parameter `*rnd->d`
  197.   }
  198.   
  199. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  200.   {
  201.       return bnrand(0, rnd, bits, top, bottom);

crypto/bn/bn_rand.c:201:12: Call
  199.   int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  200.   {
  201.       return bnrand(0, rnd, bits, top, bottom);
                    ^
  202.   }
  203.   

crypto/bn/bn_rand.c:118:1: Parameter `*rnd->d`
    116.   #include <openssl/sha.h>
    117.   
    118. > static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
    119.   {
    120.       unsigned char *buf = NULL;

crypto/bn/bn_rand.c:130:9: Call
    128.   
    129.       if (bits == 0) {
    130.           BN_zero(rnd);
                   ^
    131.           return 1;
    132.       }

crypto/bn/bn_lib.c:520:1: <Length trace>
518.   }
519.   
520. > int BN_set_word(BIGNUM *a, BN_ULONG w)
521.   {
522.       bn_check_top(a);

crypto/bn/bn_lib.c:520:1: Parameter `*a->d`
      518.   }
      519.   
      520. > int BN_set_word(BIGNUM *a, BN_ULONG w)
      521.   {
      522.       bn_check_top(a);

crypto/bn/bn_lib.c:523:9: Call
      521.   {
      522.       bn_check_top(a);
      523.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                     ^
      524.           return (0);
      525.       a->neg = 0;

crypto/bn/bn_lcl.h:777:1: Parameter `*a->d`
        775.   int bn_probable_prime_dh_coprime(BIGNUM *rnd, int bits, BN_CTX *ctx);
        776.   
        777. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
        778.   {
        779.       if (bits > (INT_MAX - BN_BITS2 + 1))

crypto/bn/bn_lib.c:526:5: Array access: Offset: 0 Size: [0, 8388607] by call to `BN_rand` 
      524.           return (0);
      525.       a->neg = 0;
      526.       a->d[0] = w;
                 ^
      527.       a->top = (w ? 1 : 0);
      528.       bn_check_top(a);
