Skip to content

Commit b43fb41

Browse files
committed
remove word16 cast, add WOLFSSL_MAX_16BIT check
1 parent 36328e3 commit b43fb41

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/tls13.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12166,7 +12166,7 @@ static int SendTls13NewSessionTicket(WOLFSSL* ssl)
1216612166
/* Nonce */
1216712167
length += TICKET_NONCE_LEN_SZ + DEF_TICKET_NONCE_SZ;
1216812168

12169-
sendSz = (word16)(idx + length + MAX_MSG_EXTRA);
12169+
sendSz = (int)(idx + length + MAX_MSG_EXTRA);
1217012170

1217112171
/* Check buffers are big enough and grow if needed. */
1217212172
if ((ret = CheckAvailableSize(ssl, sendSz)) != 0)
@@ -12222,7 +12222,8 @@ static int SendTls13NewSessionTicket(WOLFSSL* ssl)
1222212222
idx += EXTS_SZ;
1222312223
#endif
1222412224

12225-
if (idx > WOLFSSL_MAX_16BIT) {
12225+
if (idx > WOLFSSL_MAX_16BIT ||
12226+
sendSz > (int)WOLFSSL_MAX_16BIT) {
1222612227
return BAD_LENGTH_E;
1222712228
}
1222812229

0 commit comments

Comments
 (0)