mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 17:55:40 +01:00
A different approach of signed-to-unsigned comparison
Suggsted by @hanno-arm Signed-off-by: makise-homura <akemi_homura@kurisa.ch>
This commit is contained in:
parent
e014fece50
commit
af9513bb48
@ -2048,7 +2048,7 @@ int mbedtls_ssl_fetch_input( mbedtls_ssl_context *ssl, size_t nb_want )
|
|||||||
if( ret < 0 )
|
if( ret < 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
||||||
if ( (size_t)ret > len || ( INT_MAX > SIZE_MAX && (size_t)ret > SIZE_MAX ) )
|
if ( (size_t)ret > len || ( INT_MAX > SIZE_MAX && ret > (int)SIZE_MAX ) )
|
||||||
{
|
{
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 1,
|
MBEDTLS_SSL_DEBUG_MSG( 1,
|
||||||
( "f_recv returned %d bytes but only %lu were requested",
|
( "f_recv returned %d bytes but only %lu were requested",
|
||||||
@ -2102,7 +2102,7 @@ int mbedtls_ssl_flush_output( mbedtls_ssl_context *ssl )
|
|||||||
if( ret <= 0 )
|
if( ret <= 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
||||||
if( (size_t)ret > ssl->out_left || ( INT_MAX > SIZE_MAX && (size_t)ret > SIZE_MAX ) )
|
if( (size_t)ret > ssl->out_left || ( INT_MAX > SIZE_MAX && ret > (int)SIZE_MAX ) )
|
||||||
{
|
{
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 1,
|
MBEDTLS_SSL_DEBUG_MSG( 1,
|
||||||
( "f_send returned %d bytes but only %lu bytes were sent",
|
( "f_send returned %d bytes but only %lu bytes were sent",
|
||||||
|
Loading…
Reference in New Issue
Block a user