remove word16 cast, add WOLFSSL_MAX_16BIT check

This commit is contained in:
Ruby Martin
2026-03-05 13:22:30 -07:00
parent 36328e31a5
commit b43fb41024
+3 -2
View File
@@ -12166,7 +12166,7 @@ static int SendTls13NewSessionTicket(WOLFSSL* ssl)
/* Nonce */
length += TICKET_NONCE_LEN_SZ + DEF_TICKET_NONCE_SZ;
sendSz = (word16)(idx + length + MAX_MSG_EXTRA);
sendSz = (int)(idx + length + MAX_MSG_EXTRA);
/* Check buffers are big enough and grow if needed. */
if ((ret = CheckAvailableSize(ssl, sendSz)) != 0)
@@ -12222,7 +12222,8 @@ static int SendTls13NewSessionTicket(WOLFSSL* ssl)
idx += EXTS_SZ;
#endif
if (idx > WOLFSSL_MAX_16BIT) {
if (idx > WOLFSSL_MAX_16BIT ||
sendSz > (int)WOLFSSL_MAX_16BIT) {
return BAD_LENGTH_E;
}