Merge 5a7fae71cbb57e44ec01f92ecbb221a43e91885d into 3bb373867917b674265067cbd38b9d252c43d014

This commit is contained in:
Abel Thomas 2026-07-20 21:00:50 +01:00 committed by GitHub
commit 3566de8db9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -782,6 +782,12 @@ static int ssl_tls13_parse_supported_versions_ext(mbedtls_ssl_context *ssl,
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, 1);
versions_len = p[0];
/* RFC 8446, Section 4.2.1 (versions<2..254>) and Section 3.4
* (vector length must be a multiple of the element size). */
if ( (versions_len < 2) || (versions_len > 254) || (versions_len % 2 != 0))
return MBEDTLS_ERR_SSL_DECODE_ERROR;
p += 1;
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, versions_len);