test/ectest.c:838: 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:838:32: Call
836.           fflush(stdout);
837.   
838.           if (!BN_pseudo_rand(y, BN_num_bits(y), 0, 0))
                                      ^
839.               ABORT;
840.           if (!BN_add(z, z, y))

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:838:14: Call
836.           fflush(stdout);
837.   
838.           if (!BN_pseudo_rand(y, BN_num_bits(y), 0, 0))
                    ^
839.               ABORT;
840.           if (!BN_add(z, z, y))

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:79:9: Assignment
      77.   
      78.       if (num <= 0)
      79.           return NULL;
                    ^
      80.   
      81.       allow_customize = 0;

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;
