test/sm2_internal_test.c:167: 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:156:17: Call
154.   
155.       if (!TEST_ptr(expected)
156.               || !TEST_true(BN_hex2bn(&priv, privkey_hex)))
                       ^
157.           goto done;
158.   

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:167:17: Call
165.       pt = EC_POINT_new(group);
166.       if (!TEST_ptr(pt)
167.               || !TEST_true(EC_POINT_mul(group, pt, priv, NULL, NULL, NULL))
                       ^
168.               || !TEST_true(EC_KEY_set_public_key(key, pt))
169.               || !TEST_true(sm2_ciphertext_size(key, digest, msg_len, &ctext_len)))

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:354:1: Parameter `scalar->top`
      352.    * in the addition if scalar != NULL
      353.    */
      354. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
      355.                   size_t num, const EC_POINT *points[], const BIGNUM *scalars[],
      356.                   BN_CTX *ctx)

crypto/ec/ec_mult.c:406:20: Call
      404.                * constant time version.
      405.                */
      406.               return ec_mul_consttime(group, r, scalar, NULL, ctx);
                                ^
      407.           }
      408.           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:180:10: Call
        178.           goto err;
        179.   
        180.       if (!BN_copy(k, scalar))
                        ^
        181.           goto err;
        182.   

crypto/bn/bn_lib.c:280:1: <Offset trace>
278.   }
279.   
280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
281.   {
282.       bn_check_top(b);

crypto/bn/bn_lib.c:280:1: Parameter `b->top`
          278.   }
          279.   
          280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
          281.   {
          282.       bn_check_top(b);

crypto/bn/bn_lib.c:280:1: <Length trace>
278.   }
279.   
280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
281.   {
282.       bn_check_top(b);

crypto/bn/bn_lib.c:280:1: Parameter `*a->d`
          278.   }
          279.   
          280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
          281.   {
          282.       bn_check_top(b);

crypto/bn/bn_lib.c:286:9: Call
          284.       if (a == b)
          285.           return a;
          286.       if (bn_wexpand(a, b->top) == NULL)
                         ^
          287.           return NULL;
          288.   

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

crypto/bn/bn_lib.c:290:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINT_mul` 
          288.   
          289.       if (b->top > 0)
          290.           memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
                         ^
          291.   
          292.       a->neg = b->neg;
