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


crypto/ec/ecdsa_ossl.c:211:1: Parameter `eckey->group->order->top`
209.   }
210.   
211. > ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
212.                                  const BIGNUM *in_kinv, const BIGNUM *in_r,
213.                                  EC_KEY *eckey)

crypto/ec/ecdsa_ossl.c:260:9: Call
258.           goto err;
259.       }
260.       i = BN_num_bits(order);
               ^
261.       /*
262.        * Need to truncate digest if it is too long: first truncate whole bytes.

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

crypto/bn/bn_lib.c:827:1: Parameter `a->top`
    825.   }
    826.   
    827. > int BN_is_zero(const BIGNUM *a)
    828.   {
    829.       return a->top == 0;

crypto/ec/ecdsa_ossl.c:277:18: Call
275.       do {
276.           if (in_kinv == NULL || in_r == NULL) {
277.               if (!ecdsa_sign_setup(eckey, ctx, &kinv, &ret->r, dgst, dgst_len)) {
                        ^
278.                   ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_ECDSA_LIB);
279.                   goto err;

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

crypto/ec/ecdsa_ossl.c:82:18: Call
  80.   
  81.       /* Preallocate space */
  82.       order_bits = BN_num_bits(order);
                         ^
  83.       if (!BN_set_bit(k, order_bits)
  84.           || !BN_set_bit(r, order_bits)

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

crypto/bn/bn_lib.c:827:1: Parameter `a->top`
      825.   }
      826.   
      827. > int BN_is_zero(const BIGNUM *a)
      828.   {
      829.       return a->top == 0;

crypto/ec/ecdsa_ossl.c:100:22: Call
  98.                   }
  99.               } else {
  100.                   if (!BN_priv_rand_range(k, order)) {
                              ^
  101.                       ECerr(EC_F_ECDSA_SIGN_SETUP,
  102.                                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:120:14: Call
  118.            * conditional copy.
  119.            */
  120.           if (!BN_add(r, k, order)
                      ^
  121.               || !BN_add(X, r, order)
  122.               || !BN_copy(k, BN_num_bits(r) > order_bits ? r : X))

crypto/bn/bn_add.c:14:1: Parameter `b->top`
    12.   
    13.   /* signed add of b to a. */
    14. > int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
    15.   {
    16.       int ret, r_neg, cmp_res;

crypto/ec/ecdsa_ossl.c:121:17: Call
  119.            */
  120.           if (!BN_add(r, k, order)
  121.               || !BN_add(X, r, order)
                         ^
  122.               || !BN_copy(k, BN_num_bits(r) > order_bits ? r : X))
  123.               goto err;

crypto/bn/bn_add.c:14:1: Parameter `b->top`
    12.   
    13.   /* signed add of b to a. */
    14. > int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
    15.   {
    16.       int ret, r_neg, cmp_res;

crypto/ec/ecdsa_ossl.c:126:14: Call
  124.   
  125.           /* compute r the x-coordinate of generator * k */
  126.           if (!EC_POINT_mul(group, tmp_point, k, NULL, NULL, ctx)) {
                      ^
  127.               ECerr(EC_F_ECDSA_SIGN_SETUP, ERR_R_EC_LIB);
  128.               goto err;

crypto/ec/ec_lib.c:922:1: Parameter `group->order->top`
    920.   }
    921.   
    922. > int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar,
    923.                    const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx)
    924.   {

crypto/ec/ec_lib.c:933:12: Call
    931.       scalars[0] = p_scalar;
    932.   
    933.       return EC_POINTs_mul(group, r, g_scalar,
                      ^
    934.                            (point != NULL
    935.                             && p_scalar != NULL), points, scalars, ctx);

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

crypto/ec/ec_lib.c:917:16: Call
      915.       if (group->meth->mul == 0)
      916.           /* use default */
      917.           return ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
                            ^
      918.   
      919.       return group->meth->mul(group, r, scalar, num, points, scalars, ctx);

crypto/ec/ec_mult.c:346:1: Parameter `group->order->top`
        344.    * in the addition if scalar != NULL
        345.    */
        346. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
        347.                   size_t num, const EC_POINT *points[], const BIGNUM *scalars[],
        348.                   BN_CTX *ctx)

crypto/ec/ec_mult.c:388:16: Call
        386.            * constant time version.
        387.            */
        388.           return ec_mul_consttime(group, r, scalar, NULL, ctx);
                              ^
        389.       }
        390.       if ((scalar == NULL) && (num == 1)) {

crypto/ec/ec_mult.c:167:14: Call
          165.   
          166.       BN_CTX_start(ctx);
          167.       lambda = BN_CTX_get(ctx);
                              ^
          168.       k = BN_CTX_get(ctx);
          169.       if (k == NULL)

crypto/bn/bn_ctx.c:229:5: Call
            227.       }
            228.       /* OK, make sure the returned bignum is "zero" */
            229.       BN_zero(ret);
                       ^
            230.       ctx->used++;
            231.       CTXDBG_RET(ctx, ret);

crypto/bn/bn_lib.c:357:1: Parameter `*a->d`
              355.   }
              356.   
              357. > int BN_set_word(BIGNUM *a, BN_ULONG w)
              358.   {
              359.       bn_check_top(a);

crypto/bn/bn_lib.c:360:9: Call
              358.   {
              359.       bn_check_top(a);
              360.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                             ^
              361.           return 0;
              362.       a->neg = 0;

crypto/bn/bn_lcl.h:651:1: Parameter `*a->d`
                649.                            const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
                650.   
                651. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
                652.   {
                653.       if (bits > (INT_MAX - BN_BITS2 + 1))

crypto/ec/ec_mult.c:207:5: Call
          205.        */
          206.       kbit = BN_is_bit_set(lambda, order_bits);
          207.       BN_consttime_swap(kbit, k, lambda, group_top + 1);
                     ^
          208.   
          209.       group_top = bn_get_top(group->field);

crypto/bn/bn_lib.c:724:1: <Offset trace>
722.    * a and b cannot be the same number
723.    */
724. > void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
725.   {
726.       BN_ULONG t;

crypto/bn/bn_lib.c:724:1: Parameter `nwords`
            722.    * a and b cannot be the same number
            723.    */
            724. > void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
            725.   {
            726.       BN_ULONG t;

crypto/bn/bn_lib.c:724:1: <Length trace>
722.    * a and b cannot be the same number
723.    */
724. > void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
725.   {
726.       BN_ULONG t;

crypto/bn/bn_lib.c:724:1: Parameter `*b->d`
            722.    * a and b cannot be the same number
            723.    */
            724. > void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords)
            725.   {
            726.       BN_ULONG t;

crypto/bn/bn_lib.c:765:13: Array access: Offset: [10, +oo] Size: [0, 8388607] by call to `ecdsa_sign_setup` 
            763.       default:
            764.           for (i = 10; i < nwords; i++)
            765.               BN_CONSTTIME_SWAP(i);
                               ^
            766.           /* Fallthrough */
            767.       case 10:
