mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-06 08:10:50 +02:00
remove word16 cast, add WOLFSSL_MAX_16BIT check
This commit is contained in:
+3
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user