[PATCH v2] mpi: Fix error that point not uninitialized
Tianjia Zhang
tianjia.zhang at linux.alibaba.com
Wed Jan 8 14:36:49 CET 2020
* cipher/ecc-curves.c (mpi_ec_get_elliptic_curve): Initialize E->G poing
Signed-off-by: Tianjia Zhang <tianjia.zhang at linux.alibaba.com>
---
cipher/ecc-curves.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/cipher/ecc-curves.c b/cipher/ecc-curves.c
index 1592d23a..92850ac7 100644
--- a/cipher/ecc-curves.c
+++ b/cipher/ecc-curves.c
@@ -1058,6 +1058,7 @@ mpi_ec_get_elliptic_curve (elliptic_curve_t *E, int *r_flags,
goto leave;
if (G)
{
+ _gcry_mpi_point_init (&E->G);
mpi_point_set (&E->G, G->x, G->y, G->z);
mpi_point_set (G, NULL, NULL, NULL);
mpi_point_release (G);
--
2.17.1
More information about the Gcrypt-devel
mailing list