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


test/bntest.c:446:9: Call
444.   
445.       for (i = 0; i < NUM0; i++) {
446.           BN_rand(a, 512, 0, 0);
               ^
447.           BN_copy(b, BN_value_one());
448.           a->neg = rand_neg();

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:446:9: Call
444.   
445.       for (i = 0; i < NUM0; i++) {
446.           BN_rand(a, 512, 0, 0);
               ^
447.           BN_copy(b, BN_value_one());
448.           a->neg = rand_neg();

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:387:1: <Length trace>
385.   }
386.   
387. > int BN_set_word(BIGNUM *a, BN_ULONG w)
388.   {
389.       bn_check_top(a);

crypto/bn/bn_lib.c:387:1: Parameter `*a->d`
      385.   }
      386.   
      387. > int BN_set_word(BIGNUM *a, BN_ULONG w)
      388.   {
      389.       bn_check_top(a);

crypto/bn/bn_lib.c:390:9: Call
      388.   {
      389.       bn_check_top(a);
      390.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                     ^
      391.           return (0);
      392.       a->neg = 0;

crypto/bn/bn_lcl.h:651:1: Parameter `*a->d`
        649.                            const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
        650.   
        651. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
        652.   {
        653.       if (bits > (INT_MAX - BN_BITS2 + 1))

crypto/bn/bn_lib.c:393:5: Array access: Offset: 0 Size: [0, 8388607] by call to `BN_rand` 
      391.           return (0);
      392.       a->neg = 0;
      393.       a->d[0] = w;
                 ^
      394.       a->top = (w ? 1 : 0);
      395.       bn_check_top(a);
