Skip to content

Commit

Permalink
Resolves Mbed-TLS#2916
Browse files Browse the repository at this point in the history
It is sufficient to check for the strongest limit only.
  • Loading branch information
irwir committed Apr 1, 2020
1 parent 65cc9a2 commit 32d1a9d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions library/ssl_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2971,9 +2971,7 @@ static int ssl_write_certificate_request( mbedtls_ssl_context *ssl )
{
dn_size = crt->subject_raw.len;

if( end < p ||
(size_t)( end - p ) < dn_size ||
(size_t)( end - p ) < 2 + dn_size )
if( end < p || (size_t)( end - p ) < 2 + dn_size )
{
MBEDTLS_SSL_DEBUG_MSG( 1, ( "skipping CAs: buffer too short" ) );
break;
Expand Down

0 comments on commit 32d1a9d

Please sign in to comment.