Fix potential integer overflow in prev. commit

Found by Clang's -Wshift-count-overflow
This commit is contained in:
Manuel Pégourié-Gonnard 2015-12-01 09:31:52 +01:00
parent 15b15d1361
commit e3e8edfa51

View File

@ -362,7 +362,7 @@ size_t mbedtls_mpi_lsb( const mbedtls_mpi *X )
static size_t mbedtls_clz( const mbedtls_mpi_uint x ) static size_t mbedtls_clz( const mbedtls_mpi_uint x )
{ {
size_t j; 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++ ) for( j = 0; j < biL; j++ )
{ {