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


test/bntest.c:1881:10: Call
1879.   
1880.       /* Test BN_rand for degenerate cases with |top| and |bottom| parameters. */
1881.       if (!TEST_false(BN_rand(bn, 0, 0 /* top */ , 0 /* bottom */ ))
                 ^
1882.               || !TEST_false(BN_rand(bn, 0, 1 /* top */ , 1 /* bottom */ ))
1883.               || !TEST_true(BN_rand(bn, 1, 0 /* top */ , 0 /* bottom */ ))

crypto/bn/bn_rand.c:97:1: Parameter `*rnd->d`
  95.   }
  96.   
  97. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  98.   {
  99.       return bnrand(NORMAL, rnd, bits, top, bottom);

crypto/bn/bn_rand.c:99:12: Call
  97.   int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  98.   {
  99.       return bnrand(NORMAL, rnd, bits, top, bottom);
                    ^
  100.   }
  101.   

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

test/bntest.c:1882:17: Call
1880.       /* Test BN_rand for degenerate cases with |top| and |bottom| parameters. */
1881.       if (!TEST_false(BN_rand(bn, 0, 0 /* top */ , 0 /* bottom */ ))
1882.               || !TEST_false(BN_rand(bn, 0, 1 /* top */ , 1 /* bottom */ ))
                        ^
1883.               || !TEST_true(BN_rand(bn, 1, 0 /* top */ , 0 /* bottom */ ))
1884.               || !TEST_BN_eq_one(bn)

crypto/bn/bn_rand.c:97:1: Parameter `*rnd->d`
  95.   }
  96.   
  97. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  98.   {
  99.       return bnrand(NORMAL, rnd, bits, top, bottom);

crypto/bn/bn_rand.c:99:12: Call
  97.   int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  98.   {
  99.       return bnrand(NORMAL, rnd, bits, top, bottom);
                    ^
  100.   }
  101.   

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

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

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

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

crypto/bn/bn_lib.c:361:9: Call
      359.   {
      360.       bn_check_top(a);
      361.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                     ^
      362.           return 0;
      363.       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:364:5: Array access: Offset: 0 Size: [0, 8388607] by call to `BN_rand` 
      362.           return 0;
      363.       a->neg = 0;
      364.       a->d[0] = w;
                 ^
      365.       a->top = (w ? 1 : 0);
      366.       a->flags &= ~BN_FLG_FIXED_TOP;
