diff options
| author | Frédéric Desbiens <[email protected]> | 2025-09-29 08:38:27 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-09-29 08:38:27 +0100 |
| commit | b39da813adf98532fe65debfe7c9c0b6d7e1f292 (patch) | |
| tree | 72548b9811f91c0a2ee72d5eb559207c95785692 | |
| parent | 304fc836ffee0ca0295e621b9a69c0cc5a836553 (diff) | |
| parent | ef78bf896fd4deb46d1f4e63ffe9a2a6ecab2887 (diff) | |
Merge commit from fork
Fixed issue in _nx_secure_tls_process_clienthello()
| -rw-r--r-- | nx_secure/src/nx_secure_tls_process_clienthello.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nx_secure/src/nx_secure_tls_process_clienthello.c b/nx_secure/src/nx_secure_tls_process_clienthello.c index 8878d81e..0e831a16 100644 --- a/nx_secure/src/nx_secure_tls_process_clienthello.c +++ b/nx_secure/src/nx_secure_tls_process_clienthello.c @@ -280,6 +280,12 @@ USHORT no_extension = NX_FALSE; length += session_id_length; } + /* GHSA-5vrv-8j5h-h6h6 2504xx */ + if ((length + 1) >= message_length) + { + return(NX_SECURE_TLS_INCORRECT_MESSAGE_LENGTH); + } + /* Negotiate the ciphersuite we want to use. */ ciphersuite_list_length = (USHORT)((packet_buffer[length] << 8) + packet_buffer[length + 1]); length += 2; @@ -294,6 +300,12 @@ USHORT no_extension = NX_FALSE; length += ciphersuite_list_length; + /* GHSA-5vrv-8j5h-h6h6 2504xx */ + if (length >= message_length) + { + return(NX_SECURE_TLS_INCORRECT_MESSAGE_LENGTH); + } + /* Compression methods length - one byte. For now we only support the NULL method. */ compression_methods_length = packet_buffer[length]; length++; |
