Fix possible uninitialization error

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2022-12-21 11:54:22 +01:00
parent 78c4fb4551
commit f65c71fbe6
No known key found for this signature in database
GPG key ID: F072ACA227ACD71D

View file

@ -207,6 +207,9 @@ void mpi_mod_mul_neg( char * input_A,
mbedtls_mpi_mod_modulus m;
mbedtls_mpi_mod_modulus_init( &m );
mbedtls_mpi_mod_modulus fake_m;
mbedtls_mpi_mod_modulus_init( &fake_m );
TEST_EQUAL( test_read_modulus( &m, MBEDTLS_MPI_MOD_REP_MONTGOMERY, input_N ),
0 );
@ -223,9 +226,6 @@ void mpi_mod_mul_neg( char * input_A,
TEST_EQUAL( mbedtls_mpi_mod_mul( &rX, &rA, &rB, &m ), exp_ret );
mbedtls_mpi_mod_modulus fake_m;
mbedtls_mpi_mod_modulus_init( &fake_m );
/* Check when m is not initialized */
TEST_EQUAL( mbedtls_mpi_mod_mul( &rX, &rA, &rB, &fake_m ),
MBEDTLS_ERR_MPI_BAD_INPUT_DATA );