mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-07 10:25:34 +00:00
Prevent arithmetic overflow on bounds check
This commit is contained in:
parent
ce0d3ca128
commit
c86b880411
|
@ -2246,7 +2246,7 @@ static int ssl_parse_server_key_exchange( mbedtls_ssl_context *ssl )
|
|||
sig_len = ( p[0] << 8 ) | p[1];
|
||||
p += 2;
|
||||
|
||||
if( end != p + sig_len )
|
||||
if( p != end - sig_len )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad server key exchange message" ) );
|
||||
return( MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE );
|
||||
|
|
Loading…
Reference in a new issue