F-4809 - Widen ClientHello extension length check to avoid word16 truncation

This commit is contained in:
aidan garske
2026-06-25 14:59:21 -07:00
parent daf99ae645
commit 89bf094a5d
+1 -1
View File
@@ -4393,7 +4393,7 @@ static int ProcessClientHello(const byte* input, int* sslBytes,
}
/* make sure the extension fits in the remaining declared length */
if ((word16)(extLen + EXT_TYPE_SZ + LENGTH_SZ) > len) {
if ((word32)extLen + EXT_TYPE_SZ + LENGTH_SZ > len) {
SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
return WOLFSSL_FATAL_ERROR;
}