From e3e8edfa51332fa9f8831e4ba6d52caff061fe0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 1 Dec 2015 09:31:52 +0100 Subject: [PATCH] Fix potential integer overflow in prev. commit Found by Clang's -Wshift-count-overflow --- library/bignum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/bignum.c b/library/bignum.c index b9279e850..76c958b8b 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -362,7 +362,7 @@ size_t mbedtls_mpi_lsb( const mbedtls_mpi *X ) static size_t mbedtls_clz( const mbedtls_mpi_uint x ) { size_t j; - mbedtls_mpi_uint mask = 1 << (biL - 1); + mbedtls_mpi_uint mask = (mbedtls_mpi_uint) 1 << (biL - 1); for( j = 0; j < biL; j++ ) {