From 741d7bdb67ce99baf49459ac38ff4f8e8d6fd691 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Mon, 29 Jul 2019 08:47:45 +1000 Subject: [PATCH] Check suite size length is valid as well as space for compression --- src/tls13.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tls13.c b/src/tls13.c index fbe3faf8b..5ae318c19 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -3880,6 +3880,8 @@ static int DoTls13SupportedVersions(WOLFSSL* ssl, const byte* input, word32 i, return BUFFER_ERROR; ato16(input + i, &suiteSz); i += OPAQUE16_LEN; + if (i + suiteSz + 1 > helloSz) + return BUFFER_ERROR; i += suiteSz; /* Compression */ b = input[i++];