From f65c71fbe6f8b472f3398f4e490c97ca16899f24 Mon Sep 17 00:00:00 2001 From: Gabor Mezei Date: Wed, 21 Dec 2022 11:54:22 +0100 Subject: [PATCH] Fix possible uninitialization error Signed-off-by: Gabor Mezei --- tests/suites/test_suite_bignum_mod.function | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/suites/test_suite_bignum_mod.function b/tests/suites/test_suite_bignum_mod.function index 527146e300..8ab8ccf32a 100644 --- a/tests/suites/test_suite_bignum_mod.function +++ b/tests/suites/test_suite_bignum_mod.function @@ -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 );