mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Fixed potential overflow in certificate size in ssl_write_certificate()
This commit is contained in:
@ -2453,7 +2453,7 @@ int ssl_write_certificate( ssl_context *ssl )
|
||||
while( crt != NULL )
|
||||
{
|
||||
n = crt->raw.len;
|
||||
if( i + 3 + n > SSL_MAX_CONTENT_LEN )
|
||||
if( n > SSL_MAX_CONTENT_LEN - 3 - i )
|
||||
{
|
||||
SSL_DEBUG_MSG( 1, ( "certificate too large, %d > %d",
|
||||
i + 3 + n, SSL_MAX_CONTENT_LEN ) );
|
||||
|
Reference in New Issue
Block a user