From 319ecf3192bce26793f92dd8c3460e878c078d26 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 2 Sep 2020 15:18:07 +0200 Subject: [PATCH] Initialize ret from test code The test function mbedtls_mpi_lt_mpi_ct did not initialize ret in test code. If there was a bug in library code whereby the library function mbedtls_mpi_lt_mpi_ct() did not set ret when it should, we might have missed it if ret happened to contain the expected value. So initialize ret to a value that we never expect. Signed-off-by: Gilles Peskine --- tests/suites/test_suite_mpi.function | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/suites/test_suite_mpi.function b/tests/suites/test_suite_mpi.function index f2702f12b..e5e03bbd2 100644 --- a/tests/suites/test_suite_mpi.function +++ b/tests/suites/test_suite_mpi.function @@ -542,7 +542,7 @@ void mbedtls_mpi_lt_mpi_ct( int size_X, char * input_X, int size_Y, char * input_Y, int input_ret, int input_err ) { - unsigned ret; + unsigned ret = -1; unsigned input_uret = input_ret; mbedtls_mpi X, Y; mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y );