crypto/bn/bn_gf2m.c:1160: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] Size: [1, +oo] by call to `BN_GF2m_mod_solve_quad_arr`.
Showing all 16 steps of the trace


crypto/bn/bn_gf2m.c:1155:11: Call
1153.       if ((arr = OPENSSL_malloc(sizeof(*arr) * max)) == NULL)
1154.           goto err;
1155.       ret = BN_GF2m_poly2arr(p, arr, max);
                  ^
1156.       if (!ret || ret > max) {
1157.           BNerr(BN_F_BN_GF2M_MOD_SOLVE_QUAD, BN_R_INVALID_LENGTH);

crypto/bn/bn_gf2m.c:1174:1: Parameter `*p`
  1172.    * be filled if array was large enough.
  1173.    */
  1174. > int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max)
  1175.   {
  1176.       int i, j, k = 0;

crypto/bn/bn_gf2m.c:1160:11: Call
1158.           goto err;
1159.       }
1160.       ret = BN_GF2m_mod_solve_quad_arr(r, a, arr, ctx);
                  ^
1161.       bn_check_top(r);
1162.    err:

crypto/bn/bn_gf2m.c:1041:1: Parameter `*p`
  1039.    * 0. Uses algorithms A.4.7 and A.4.6 from IEEE P1363.
  1040.    */
  1041. > int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a_, const int p[],
  1042.                                  BN_CTX *ctx)
  1043.   {

crypto/bn/bn_gf2m.c:1092:18: Call
  1090.               goto err;
  1091.           do {
  1092.               if (!BN_rand(rho, p[0], BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY))
                           ^
  1093.                   goto err;
  1094.               if (!BN_GF2m_mod_arr(rho, rho, p))

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

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

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:165:9: Assignment
        163.   
        164.       if (num <= 0)
        165.           return NULL;
                       ^
        166.   
        167.       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_GF2m_mod_solve_quad_arr` 
      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;
