test/bntest.c:1941: error: BUFFER_OVERRUN_L3
  Offset: 0 Size: [0, 8388607] by call to `BN_rand`.
Showing all 14 steps of the trace


test/bntest.c:1940:10: Call
1938.   
1939.       /* Test BN_rand for degenerate cases with |top| and |bottom| parameters. */
1940.       if (!TEST_false(BN_rand(bn, 0, 0 /* top */ , 0 /* bottom */ ))
                 ^
1941.               || !TEST_false(BN_rand(bn, 0, 1 /* top */ , 1 /* bottom */ ))
1942.               || !TEST_true(BN_rand(bn, 1, 0 /* top */ , 0 /* bottom */ ))

crypto/bn/bn_rand.c:114:1: Parameter `*rnd->d`
  112.   }
  113.   
  114. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  115.   {
  116.       return bnrand(NORMAL, rnd, bits, top, bottom);

crypto/bn/bn_rand.c:116:12: Call
  114.   int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  115.   {
  116.       return bnrand(NORMAL, rnd, bits, top, bottom);
                    ^
  117.   }
  118.   

crypto/bn/bn_rand.c:23:1: Parameter `*rnd->d`
    21.   } BNRAND_FLAG;
    22.   
    23. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom)
    24.   {
    25.       unsigned char *buf = NULL;

test/bntest.c:1941:17: Call
1939.       /* Test BN_rand for degenerate cases with |top| and |bottom| parameters. */
1940.       if (!TEST_false(BN_rand(bn, 0, 0 /* top */ , 0 /* bottom */ ))
1941.               || !TEST_false(BN_rand(bn, 0, 1 /* top */ , 1 /* bottom */ ))
                        ^
1942.               || !TEST_true(BN_rand(bn, 1, 0 /* top */ , 0 /* bottom */ ))
1943.               || !TEST_BN_eq_one(bn)

crypto/bn/bn_rand.c:114:1: Parameter `*rnd->d`
  112.   }
  113.   
  114. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  115.   {
  116.       return bnrand(NORMAL, rnd, bits, top, bottom);

crypto/bn/bn_rand.c:116:12: Call
  114.   int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  115.   {
  116.       return bnrand(NORMAL, rnd, bits, top, bottom);
                    ^
  117.   }
  118.   

crypto/bn/bn_rand.c:23:1: Parameter `*rnd->d`
    21.   } BNRAND_FLAG;
    22.   
    23. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom)
    24.   {
    25.       unsigned char *buf = NULL;

crypto/bn/bn_rand.c:31:9: Call
    29.           if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY)
    30.               goto toosmall;
    31.           BN_zero(rnd);
                  ^
    32.           return 1;
    33.       }

crypto/bn/bn_lib.c:361:1: <Length trace>
359.   }
360.   
361. > int BN_set_word(BIGNUM *a, BN_ULONG w)
362.   {
363.       bn_check_top(a);

crypto/bn/bn_lib.c:361:1: Parameter `*a->d`
      359.   }
      360.   
      361. > int BN_set_word(BIGNUM *a, BN_ULONG w)
      362.   {
      363.       bn_check_top(a);

crypto/bn/bn_lib.c:364:9: Call
      362.   {
      363.       bn_check_top(a);
      364.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                     ^
      365.           return 0;
      366.       a->neg = 0;

crypto/bn/bn_lcl.h:660:1: Parameter `*a->d`
        658.                            const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
        659.   
        660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
        661.   {
        662.       if (bits > (INT_MAX - BN_BITS2 + 1))

crypto/bn/bn_lib.c:367:5: Array access: Offset: 0 Size: [0, 8388607] by call to `BN_rand` 
      365.           return 0;
      366.       a->neg = 0;
      367.       a->d[0] = w;
                 ^
      368.       a->top = (w ? 1 : 0);
      369.       a->flags &= ~BN_FLG_FIXED_TOP;
