test/sm2_internal_test.c:282: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINT_mul`.
Showing all 19 steps of the trace


test/sm2_internal_test.c:271:10: Call
269.       BIGNUM *s = NULL;
270.   
271.       if (!TEST_true(BN_hex2bn(&priv, privkey_hex)))
                ^
272.           goto done;
273.   

crypto/bn/bn_print.c:166:5: Assignment
  164.       j = i;                      /* least significant 'hex' */
  165.       m = 0;
  166.       h = 0;
             ^
  167.       while (j > 0) {
  168.           m = (BN_BYTES * 2 <= j) ? BN_BYTES * 2 : j;

crypto/bn/bn_print.c:184:5: Assignment
  182.           j -= BN_BYTES * 2;
  183.       }
  184.       ret->top = h;
             ^
  185.       bn_correct_top(ret);
  186.   

test/sm2_internal_test.c:282:17: Call
280.       pt = EC_POINT_new(group);
281.       if (!TEST_ptr(pt)
282.               || !TEST_true(EC_POINT_mul(group, pt, priv, NULL, NULL, NULL))
                       ^
283.               || !TEST_true(EC_KEY_set_public_key(key, pt)))
284.           goto done;

crypto/ec/ec_lib.c:929:1: Parameter `g_scalar->top`
  927.   }
  928.   
  929. > int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar,
  930.                    const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx)
  931.   {

crypto/ec/ec_lib.c:940:12: Call
  938.       scalars[0] = p_scalar;
  939.   
  940.       return EC_POINTs_mul(group, r, g_scalar,
                    ^
  941.                            (point != NULL
  942.                             && p_scalar != NULL), points, scalars, ctx);

crypto/ec/ec_lib.c:918:1: Parameter `scalar->top`
    916.    */
    917.   
    918. > int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
    919.                     size_t num, const EC_POINT *points[],
    920.                     const BIGNUM *scalars[], BN_CTX *ctx)

crypto/ec/ec_lib.c:924:16: Call
    922.       if (group->meth->mul == 0)
    923.           /* use default */
    924.           return ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
                          ^
    925.   
    926.       return group->meth->mul(group, r, scalar, num, points, scalars, ctx);

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

crypto/ec/ec_mult.c:393:16: Call
      391.            * constant time version.
      392.            */
      393.           return ec_mul_consttime(group, r, scalar, NULL, ctx);
                            ^
      394.       }
      395.       if ((scalar == NULL) && (num == 1)) {

crypto/ec/ec_mult.c:131:1: Parameter `scalar->top`
        129.    * Returns 1 on success, 0 otherwise.
        130.    */
        131. > static int ec_mul_consttime(const EC_GROUP *group, EC_POINT *r,
        132.                               const BIGNUM *scalar, const EC_POINT *point,
        133.                               BN_CTX *ctx)

crypto/ec/ec_mult.c:179:10: Call
        177.           goto err;
        178.   
        179.       if (!BN_copy(k, scalar))
                        ^
        180.           goto err;
        181.   

crypto/bn/bn_lib.c:285:1: <Offset trace>
283.   }
284.   
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286.   {
287.       bn_check_top(b);

crypto/bn/bn_lib.c:285:1: Parameter `b->top`
          283.   }
          284.   
          285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
          286.   {
          287.       bn_check_top(b);

crypto/bn/bn_lib.c:285:1: <Length trace>
283.   }
284.   
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286.   {
287.       bn_check_top(b);

crypto/bn/bn_lib.c:285:1: Parameter `*a->d`
          283.   }
          284.   
          285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
          286.   {
          287.       bn_check_top(b);

crypto/bn/bn_lib.c:291:9: Call
          289.       if (a == b)
          290.           return a;
          291.       if (bn_wexpand(a, b->top) == NULL)
                         ^
          292.           return NULL;
          293.   

crypto/bn/bn_lib.c:941:1: Parameter `*a->d`
            939.   }
            940.   
            941. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
            942.   {
            943.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_lib.c:295:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINT_mul` 
          293.   
          294.       if (b->top > 0)
          295.           memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
                         ^
          296.   
          297.       a->top = b->top;
