tls: fix off by one in supported versions extension

Ticket: #5663
(cherry picked from commit b5147189ae)
pull/8374/head
Philippe Antoine 3 years ago committed by Victor Julien
parent b24ae521a2
commit 462366d447

@ -1006,7 +1006,7 @@ static inline int TLSDecodeHSHelloExtensionSupportedVersions(SSLState *ssl_state
/* Use the first (and prefered) valid version as client version,
* skip over GREASE and other possible noise. */
uint16_t i = 0;
while (i < (uint16_t)supported_ver_len) {
while (i + 1 < (uint16_t)supported_ver_len) {
uint16_t ver = (uint16_t)(input[i] << 8) | input[i + 1];
if (TLSVersionValid(ver)) {
ssl_state->curr_connp->version = ver;

Loading…
Cancel
Save