Unverified Commit b03b0c7f authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5460 v2 crypto: lib/mpi - Fix unexpected pointer access in mpi_ec_init

parents 5914a44e 1b86a3bd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -584,6 +584,9 @@ void mpi_ec_init(struct mpi_ec_ctx *ctx, enum gcry_mpi_ec_models model,
	ctx->a = mpi_copy(a);
	ctx->b = mpi_copy(b);

	ctx->d = NULL;
	ctx->t.two_inv_p = NULL;

	ctx->t.p_barrett = use_barrett > 0 ? mpi_barrett_init(ctx->p, 0) : NULL;

	mpi_ec_get_reset(ctx);