crypto/ec/ecdsa_ossl.c:223: error: BUFFER_OVERRUN_L3
  Offset: [1, +oo] Size: [0, 8388607] by call to `ecdsa_sign_setup`.
Showing all 28 steps of the trace


crypto/ec/ecdsa_ossl.c:161:1: Parameter `eckey->group->order->top`
159.   }
160.   
161. > ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
162.                                  const BIGNUM *in_kinv, const BIGNUM *in_r,
163.                                  EC_KEY *eckey)

crypto/ec/ecdsa_ossl.c:206:9: Call
204.   
205.       order = EC_GROUP_get0_order(group);
206.       i = BN_num_bits(order);
               ^
207.       /*
208.        * Need to truncate digest if it is too long: first truncate whole bytes.

crypto/bn/bn_lib.c:140:9: Call
  138.       bn_check_top(a);
  139.   
  140.       if (BN_is_zero(a))
                 ^
  141.           return 0;
  142.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:852:1: Parameter `a->top`
    850.   }
    851.   
    852. > int BN_is_zero(const BIGNUM *a)
    853.   {
    854.       return a->top == 0;

crypto/ec/ecdsa_ossl.c:223:18: Call
221.       do {
222.           if (in_kinv == NULL || in_r == NULL) {
223.               if (!ecdsa_sign_setup(eckey, ctx, &kinv, &ret->r, dgst, dgst_len)) {
                        ^
224.                   ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_ECDSA_LIB);
225.                   goto err;

crypto/ec/ecdsa_ossl.c:33:1: Parameter `eckey->group->order->top`
  31.   }
  32.   
  33. > static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in,
  34.                               BIGNUM **kinvp, BIGNUM **rp,
  35.                               const unsigned char *dgst, int dlen)

crypto/ec/ecdsa_ossl.c:76:18: Call
  74.   
  75.       /* Preallocate space */
  76.       order_bits = BN_num_bits(order);
                         ^
  77.       if (!BN_set_bit(k, order_bits)
  78.           || !BN_set_bit(r, order_bits)

crypto/bn/bn_lib.c:140:9: Call
    138.       bn_check_top(a);
    139.   
    140.       if (BN_is_zero(a))
                   ^
    141.           return 0;
    142.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:852:1: Parameter `a->top`
      850.   }
      851.   
      852. > int BN_is_zero(const BIGNUM *a)
      853.   {
      854.       return a->top == 0;

crypto/ec/ecdsa_ossl.c:86:22: Call
  84.           do {
  85.               if (dgst != NULL) {
  86.                   if (!BN_generate_dsa_nonce(k, order,
                             ^
  87.                                              EC_KEY_get0_private_key(eckey),
  88.                                              dgst, dlen, ctx)) {

crypto/bn/bn_rand.c:205:1: Parameter `range->top`
    203.    * used.
    204.    */
    205. > int BN_generate_dsa_nonce(BIGNUM *out, const BIGNUM *range,
    206.                             const BIGNUM *priv, const unsigned char *message,
    207.                             size_t message_len, BN_CTX *ctx)

crypto/bn/bn_rand.c:218:34: Call
    216.       unsigned done, todo;
    217.       /* We generate |range|+8 bytes of random output. */
    218.       const unsigned num_k_bytes = BN_num_bytes(range) + 8;
                                            ^
    219.       unsigned char private_bytes[96];
    220.       unsigned char *k_bytes;

crypto/bn/bn_lib.c:140:9: Call
      138.       bn_check_top(a);
      139.   
      140.       if (BN_is_zero(a))
                     ^
      141.           return 0;
      142.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:852:1: Parameter `a->top`
        850.   }
        851.   
        852. > int BN_is_zero(const BIGNUM *a)
        853.   {
        854.       return a->top == 0;

crypto/bn/bn_rand.c:260:9: Call
    258.       if (!BN_bin2bn(k_bytes, num_k_bytes, out))
    259.           goto err;
    260.       if (BN_mod(out, out, range, ctx) != 1)
                   ^
    261.           goto err;
    262.       ret = 1;

crypto/bn/bn_div.c:199:31: Call
      197.   
      198.       /* First we normalise the numbers */
      199.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
                                           ^
      200.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
      201.           goto err;

crypto/bn/bn_lib.c:141:9: Assignment
        139.   
        140.       if (BN_is_zero(a))
        141.           return 0;
                       ^
        142.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
        143.   }

crypto/bn/bn_div.c:199:5: Assignment
      197.   
      198.       /* First we normalise the numbers */
      199.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
                 ^
      200.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
      201.           goto err;

crypto/bn/bn_div.c:200:11: Call
      198.       /* First we normalise the numbers */
      199.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
      200.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
                       ^
      201.           goto err;
      202.       sdiv->neg = 0;

crypto/bn/bn_shift.c:83:1: <Offset trace>
81.   }
82.   
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84.   {
85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:83:1: Parameter `n`
        81.   }
        82.   
        83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
        84.   {
        85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:97:5: Assignment
        95.       }
        96.   
        97.       nw = n / BN_BITS2;
                   ^
        98.       if (bn_wexpand(r, a->top + nw + 1) == NULL)
        99.           return 0;

crypto/bn/bn_shift.c:83:1: <Length trace>
81.   }
82.   
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84.   {
85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:83:1: Parameter `*r->d`
        81.   }
        82.   
        83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
        84.   {
        85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:98:9: Call
        96.   
        97.       nw = n / BN_BITS2;
        98.       if (bn_wexpand(r, a->top + nw + 1) == NULL)
                       ^
        99.           return 0;
        100.       r->neg = a->neg;

crypto/bn/bn_lib.c:948:1: Parameter `*a->d`
          946.   }
          947.   
          948. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
          949.   {
          950.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_shift.c:104:5: Assignment
        102.       rb = BN_BITS2 - lb;
        103.       f = a->d;
        104.       t = r->d;
                   ^
        105.       t[a->top + nw] = 0;
        106.       if (lb == 0)

crypto/bn/bn_shift.c:112:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `ecdsa_sign_setup` 
        110.           for (i = a->top - 1; i >= 0; i--) {
        111.               l = f[i];
        112.               t[nw + i + 1] |= (l >> rb) & BN_MASK2;
                           ^
        113.               t[nw + i] = (l << lb) & BN_MASK2;
        114.           }
