Merge pull request #873 from hanno-arm/ssl_write_client_hello
Bounds checks in ssl_write_client_hello
This commit is contained in:
commit
a92e3def48
9 changed files with 681 additions and 389 deletions
library
|
@ -4665,7 +4665,9 @@ int mbedtls_ssl_conf_alpn_protocols( mbedtls_ssl_config *conf, const char **prot
|
|||
cur_len = strlen( *p );
|
||||
tot_len += cur_len;
|
||||
|
||||
if( cur_len == 0 || cur_len > 255 || tot_len > 65535 )
|
||||
if( ( cur_len == 0 ) ||
|
||||
( cur_len > MBEDTLS_SSL_MAX_ALPN_NAME_LEN ) ||
|
||||
( tot_len > MBEDTLS_SSL_MAX_ALPN_LIST_LEN ) )
|
||||
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue