crypto/bn/bn_gf2m.c:1148: 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:1143:11: Call
1141.       if ((arr = OPENSSL_malloc(sizeof(*arr) * max)) == NULL)
1142.           goto err;
1143.       ret = BN_GF2m_poly2arr(p, arr, max);
                  ^
1144.       if (!ret || ret > max) {
1145.           BNerr(BN_F_BN_GF2M_MOD_SOLVE_QUAD, BN_R_INVALID_LENGTH);

crypto/bn/bn_gf2m.c:1162:1: Parameter `*p`
  1160.    * be filled if array was large enough.
  1161.    */
  1162. > int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max)
  1163.   {
  1164.       int i, j, k = 0;

crypto/bn/bn_gf2m.c:1148:11: Call
1146.           goto err;
1147.       }
1148.       ret = BN_GF2m_mod_solve_quad_arr(r, a, arr, ctx);
                  ^
1149.       bn_check_top(r);
1150.    err:

crypto/bn/bn_gf2m.c:1029:1: Parameter `*p`
  1027.    * 0. Uses algorithms A.4.7 and A.4.6 from IEEE P1363.
  1028.    */
  1029. > int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a_, const int p[],
  1030.                                  BN_CTX *ctx)
  1031.   {

crypto/bn/bn_gf2m.c:1080:18: Call
  1078.               goto err;
  1079.           do {
  1080.               if (!BN_priv_rand(rho, p[0], BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY))
                           ^
  1081.                   goto err;
  1082.               if (!BN_GF2m_mod_arr(rho, rho, p))

crypto/bn/bn_rand.c:107:1: Parameter `bits`
    105.   }
    106.   
    107. > int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom)
    108.   {
    109.       return bnrand(PRIVATE, rnd, bits, top, bottom);

crypto/bn/bn_rand.c:109:12: Call
    107.   int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom)
    108.   {
    109.       return bnrand(PRIVATE, rnd, bits, top, bottom);
                      ^
    110.   }
    111.   

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

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

crypto/bn/bn_rand.c:21:1: <Length trace>
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:21:1: Parameter `bits`
      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:35:5: Assignment
      33.           goto toosmall;
      34.   
      35.       bytes = (bits + 7) / 8;
                ^
      36.       bit = (bits - 1) % 8;
      37.       mask = 0xff << (bit + 1);

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

crypto/mem.c:177:9: Assignment
        175.   
        176.       if (num == 0)
        177.           return NULL;
                       ^
        178.   
        179.       FAILTEST();

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

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