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


crypto/ec/ecdsa_ossl.c:150:1: Parameter `eckey->group->order->top`
148.   }
149.   
150. > ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
151.                                  const BIGNUM *in_kinv, const BIGNUM *in_r,
152.                                  EC_KEY *eckey)

crypto/ec/ecdsa_ossl.c:195:9: Call
193.   
194.       order = EC_GROUP_get0_order(group);
195.       i = BN_num_bits(order);
               ^
196.       /*
197.        * 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:843:1: Parameter `a->top`
    841.   }
    842.   
    843. > int BN_is_zero(const BIGNUM *a)
    844.   {
    845.       return a->top == 0;

crypto/ec/ecdsa_ossl.c:212:18: Call
210.       do {
211.           if (in_kinv == NULL || in_r == NULL) {
212.               if (!ecdsa_sign_setup(eckey, ctx, &kinv, &ret->r, dgst, dgst_len)) {
                        ^
213.                   ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_ECDSA_LIB);
214.                   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:843:1: Parameter `a->top`
      841.   }
      842.   
      843. > int BN_is_zero(const BIGNUM *a)
      844.   {
      845.       return a->top == 0;

crypto/ec/ecdsa_ossl.c:94:22: Call
  92.                   }
  93.               } else {
  94.                   if (!BN_priv_rand_range(k, order)) {
                             ^
  95.                       ECerr(EC_F_ECDSA_SIGN_SETUP,
  96.                             EC_R_RANDOM_NUMBER_GENERATION_FAILED);

crypto/bn/bn_rand.c:182:1: Parameter `range->top`
    180.   }
    181.   
    182. > int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range)
    183.   {
    184.       return bnrand_range(PRIVATE, r, range);

crypto/bn/bn_rand.c:184:12: Call
    182.   int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range)
    183.   {
    184.       return bnrand_range(PRIVATE, r, range);
                      ^
    185.   }
    186.   

crypto/bn/bn_rand.c:113:1: Parameter `range->top`
      111.   
      112.   /* random number r:  0 <= r < range */
      113. > static int bnrand_range(BNRAND_FLAG flag, BIGNUM *r, const BIGNUM *range)
      114.   {
      115.       int n;

crypto/ec/ecdsa_ossl.c:103:14: Call
  101.   
  102.           /* compute r the x-coordinate of generator * k */
  103.           if (!EC_POINT_mul(group, tmp_point, k, NULL, NULL, ctx)) {
                      ^
  104.               ECerr(EC_F_ECDSA_SIGN_SETUP, ERR_R_EC_LIB);
  105.               goto err;

crypto/ec/ec_lib.c:951:1: Parameter `group->order->top`
    949.   }
    950.   
    951. > int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar,
    952.                    const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx)
    953.   {

crypto/ec/ec_lib.c:962:12: Call
    960.       scalars[0] = p_scalar;
    961.   
    962.       return EC_POINTs_mul(group, r, g_scalar,
                      ^
    963.                            (point != NULL
    964.                             && p_scalar != NULL), points, scalars, ctx);

crypto/ec/ec_lib.c:913:1: Parameter `group->order->top`
      911.    */
      912.   
      913. > int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
      914.                     size_t num, const EC_POINT *points[],
      915.                     const BIGNUM *scalars[], BN_CTX *ctx)

crypto/ec/ecdsa_ossl.c:113:14: Call
  111.           }
  112.   
  113.           if (!BN_nnmod(r, X, order, ctx)) {
                      ^
  114.               ECerr(EC_F_ECDSA_SIGN_SETUP, ERR_R_BN_LIB);
  115.               goto err;

crypto/bn/bn_mod.c:13:1: Parameter `d->top`
    11.   #include "bn_lcl.h"
    12.   
    13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
    14.   {
    15.       /*

crypto/bn/bn_mod.c:20:11: Call
    18.        */
    19.   
    20.       if (!(BN_mod(r, m, d, ctx)))
                    ^
    21.           return 0;
    22.       if (!r->neg)

crypto/bn/bn_div.c:250:31: Call
      248.   
      249.       /* First we normalise the numbers */
      250.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
                                           ^
      251.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
      252.           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:250:5: Assignment
      248.   
      249.       /* First we normalise the numbers */
      250.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
                 ^
      251.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
      252.           goto err;

crypto/bn/bn_div.c:251:11: Call
      249.       /* First we normalise the numbers */
      250.       norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
      251.       if (!(BN_lshift(sdiv, divisor, norm_shift)))
                       ^
      252.           goto err;
      253.       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:939:1: Parameter `*a->d`
          937.   }
          938.   
          939. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
          940.   {
          941.       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.           }
