mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 00:06:32 +01:00
Merge branch 'pr_1395' into development-proposed
This commit is contained in:
commit
a09453f495
2 changed files with 19 additions and 0 deletions
|
|
@ -2434,6 +2434,14 @@ int mbedtls_ssl_fetch_input( mbedtls_ssl_context *ssl, size_t nb_want )
|
|||
if( ret < 0 )
|
||||
return( ret );
|
||||
|
||||
if ( (size_t)ret > len || ( INT_MAX > SIZE_MAX && ret > SIZE_MAX ) )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1,
|
||||
( "f_recv returned %d bytes but only %lu were requested",
|
||||
ret, (unsigned long)len ) );
|
||||
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
|
||||
}
|
||||
|
||||
ssl->in_left += ret;
|
||||
}
|
||||
}
|
||||
|
|
@ -2481,6 +2489,14 @@ int mbedtls_ssl_flush_output( mbedtls_ssl_context *ssl )
|
|||
if( ret <= 0 )
|
||||
return( ret );
|
||||
|
||||
if( (size_t)ret > ssl->out_left || ( INT_MAX > SIZE_MAX && ret > SIZE_MAX ) )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1,
|
||||
( "f_send returned %d bytes but only %lu bytes were sent",
|
||||
ret, (unsigned long)ssl->out_left ) );
|
||||
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
|
||||
}
|
||||
|
||||
ssl->out_left -= ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue