Reporting bug in mpi_ec_mul_point()

From: Gustavo A. R. Silva
Date: Mon Sep 28 2020 - 14:19:01 EST


Hi all,

I'm reporting the following bug detected by Coverity:

The _scalar_copied_ variable is set to 0 at

lib/mpi/ec.c:1255:
1255 int scalar_copied = 0;

and it is never updated before reaching the code below:

lib/mpi/ec.c:1317
1317 if (scalar_copied)
1318 mpi_free(scalar);

This code was introduced by commit d58bb7e55a8a ("lib/mpi: Introduce ec
implementation to MPI library")

Any ideas on what's the right solution for this?

Thanks
--
Gustavo