crypto/bn/bn_gf2m.c:1102: 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:1097:11: Call
1095.       if ((arr = OPENSSL_malloc(sizeof(*arr) * max)) == NULL)
1096.           goto err;
1097.       ret = BN_GF2m_poly2arr(p, arr, max);
                  ^
1098.       if (!ret || ret > max) {
1099.           BNerr(BN_F_BN_GF2M_MOD_SOLVE_QUAD, BN_R_INVALID_LENGTH);

crypto/bn/bn_gf2m.c:1116:1: Parameter `*p`
  1114.    * be filled if array was large enough.
  1115.    */
  1116. > int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max)
  1117.   {
  1118.       int i, j, k = 0;

crypto/bn/bn_gf2m.c:1102:11: Call
1100.           goto err;
1101.       }
1102.       ret = BN_GF2m_mod_solve_quad_arr(r, a, arr, ctx);
                  ^
1103.       bn_check_top(r);
1104.    err:

crypto/bn/bn_gf2m.c:983:1: Parameter `*p`
  981.    * 0. Uses algorithms A.4.7 and A.4.6 from IEEE P1363.
  982.    */
  983. > int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a_, const int p[],
  984.                                  BN_CTX *ctx)
  985.   {

crypto/bn/bn_gf2m.c:1034:18: Call
  1032.               goto err;
  1033.           do {
  1034.               if (!BN_priv_rand(rho, p[0], BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY))
                           ^
  1035.                   goto err;
  1036.               if (!BN_GF2m_mod_arr(rho, rho, p))

crypto/bn/bn_rand.c:121:1: Parameter `bits`
    119.   }
    120.   
    121. > int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom)
    122.   {
    123.       return bnrand(PRIVATE, rnd, bits, top, bottom, NULL);

crypto/bn/bn_rand.c:123:12: Call
    121.   int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom)
    122.   {
    123.       return bnrand(PRIVATE, rnd, bits, top, bottom, NULL);
                      ^
    124.   }
    125.   

crypto/bn/bn_rand.c:62:14: <Offset trace>
60.           unsigned char c;
61.   
62.           for (i = 0; i < bytes; i++) {
                   ^
63.               if (rand_bytes_ex(libctx, &c, 1) <= 0)
64.                   goto err;

crypto/bn/bn_rand.c:62:14: Assignment
      60.           unsigned char c;
      61.   
      62.           for (i = 0; i < bytes; i++) {
                         ^
      63.               if (rand_bytes_ex(libctx, &c, 1) <= 0)
      64.                   goto err;

crypto/bn/bn_rand.c:23:1: <Length trace>
21.   } BNRAND_FLAG;
22.   
23. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom,
24.                     BN_CTX *ctx)
25.   {

crypto/bn/bn_rand.c:23:1: Parameter `bits`
      21.   } BNRAND_FLAG;
      22.   
      23. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom,
      24.                     BN_CTX *ctx)
      25.   {

crypto/bn/bn_rand.c:39:5: Assignment
      37.           goto toosmall;
      38.   
      39.       bytes = (bits + 7) / 8;
                ^
      40.       bit = (bits - 1) % 8;
      41.       mask = 0xff << (bit + 1);

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

crypto/mem.c:201:9: Assignment
        199.   
        200.       if (num == 0)
        201.           return NULL;
                       ^
        202.   
        203.       FAILTEST();

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

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