test/ectest.c:971: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] Size: [1, +oo] by call to `BN_pseudo_rand`.
Showing all 14 steps of the trace


test/ectest.c:971:14: Call
969.               goto err;
970.   
971.           if (!TEST_true(BN_pseudo_rand(y, BN_num_bits(y), 0, 0))
                    ^
972.               || !TEST_true(BN_add(z, z, y)))
973.               goto err;

crypto/bn/bn_lib.c:167:9: Assignment
  165.   
  166.       if (BN_is_zero(a))
  167.           return 0;
                 ^
  168.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
  169.   }

test/ectest.c:971:14: Call
969.               goto err;
970.   
971.           if (!TEST_true(BN_pseudo_rand(y, BN_num_bits(y), 0, 0))
                    ^
972.               || !TEST_true(BN_add(z, z, y)))
973.               goto err;

crypto/bn/bn_rand.c:101:1: Parameter `bits`
  99.   }
  100.   
  101. > int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom)
  102.   {
  103.       return bnrand(1, rnd, bits, top, bottom);

crypto/bn/bn_rand.c:103:12: Call
  101.   int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom)
  102.   {
  103.       return bnrand(1, rnd, bits, top, bottom);
                    ^
  104.   }
  105.   

crypto/bn/bn_rand.c:56:14: <Offset trace>
54.           unsigned char c;
55.   
56.           for (i = 0; i < bytes; i++) {
                   ^
57.               if (RAND_bytes(&c, 1) <= 0)
58.                   goto err;

crypto/bn/bn_rand.c:56:14: Assignment
    54.           unsigned char c;
    55.   
    56.           for (i = 0; i < bytes; i++) {
                       ^
    57.               if (RAND_bytes(&c, 1) <= 0)
    58.                   goto err;

crypto/bn/bn_rand.c:17:1: <Length trace>
15.   #include <openssl/sha.h>
16.   
17. > static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
18.   {
19.       unsigned char *buf = NULL;

crypto/bn/bn_rand.c:17:1: Parameter `bits`
    15.   #include <openssl/sha.h>
    16.   
    17. > static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
    18.   {
    19.       unsigned char *buf = NULL;

crypto/bn/bn_rand.c:32:5: Assignment
    30.           goto toosmall;
    31.   
    32.       bytes = (bits + 7) / 8;
              ^
    33.       bit = (bits - 1) % 8;
    34.       mask = 0xff << (bit + 1);

crypto/bn/bn_rand.c:36:11: Call
    34.       mask = 0xff << (bit + 1);
    35.   
    36.       buf = OPENSSL_malloc(bytes);
                    ^
    37.       if (buf == NULL) {
    38.           BNerr(BN_F_BNRAND, ERR_R_MALLOC_FAILURE);

crypto/mem.c:166:9: Assignment
      164.   
      165.       if (num == 0)
      166.           return NULL;
                     ^
      167.   
      168.       FAILTEST();

crypto/bn/bn_rand.c:36:5: Assignment
    34.       mask = 0xff << (bit + 1);
    35.   
    36.       buf = OPENSSL_malloc(bytes);
              ^
    37.       if (buf == NULL) {
    38.           BNerr(BN_F_BNRAND, ERR_R_MALLOC_FAILURE);

crypto/bn/bn_rand.c:82:9: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_pseudo_rand` 
    80.       buf[0] &= ~mask;
    81.       if (bottom)                 /* set bottom bit if requested */
    82.           buf[bytes - 1] |= 1;
                  ^
    83.       if (!BN_bin2bn(buf, bytes, rnd))
    84.           goto err;
