From 7796cc4f24245a98a2508f298294c0fc4e6b4577 Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Tue, 20 Dec 2022 13:12:23 +0000 Subject: [PATCH] Fix overflow in mbedtls_timing_hardclock Signed-off-by: Dave Rodgman --- programs/test/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c index 6313c522a..1ad2034d4 100644 --- a/programs/test/benchmark.c +++ b/programs/test/benchmark.c @@ -398,7 +398,7 @@ static unsigned long mbedtls_timing_hardclock( void ) } gettimeofday( &tv_cur, NULL ); - return( ( tv_cur.tv_sec - tv_init.tv_sec ) * 1000000 + return( ( tv_cur.tv_sec - tv_init.tv_sec ) * 1000000U + ( tv_cur.tv_usec - tv_init.tv_usec ) ); } #endif /* !HAVE_HARDCLOCK */