mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-04-06 12:35:36 +02:00
Prevent arithmetic overflow on bounds check
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user