Skip to content

Commit e5594a6

Browse files
Merge pull request #9889 from rlm2002/F29
remove word16 cast, add WOLFSSL_MAX_16BIT check
2 parents 80ba723 + b43fb41 commit e5594a6

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
@@ -12321,7 +12321,7 @@ static int SendTls13NewSessionTicket(WOLFSSL* ssl)
1232112321
/* Nonce */
1232212322
length += TICKET_NONCE_LEN_SZ + DEF_TICKET_NONCE_SZ;
1232312323

12324-
sendSz = (word16)(idx + length + MAX_MSG_EXTRA);
12324+
sendSz = (int)(idx + length + MAX_MSG_EXTRA);
1232512325

1232612326
/* Check buffers are big enough and grow if needed. */
1232712327
if ((ret = CheckAvailableSize(ssl, sendSz)) != 0)
@@ -12377,7 +12377,8 @@ static int SendTls13NewSessionTicket(WOLFSSL* ssl)
1237712377
idx += EXTS_SZ;
1237812378
#endif
1237912379

12380-
if (idx > WOLFSSL_MAX_16BIT) {
12380+
if (idx > WOLFSSL_MAX_16BIT ||
12381+
sendSz > (int)WOLFSSL_MAX_16BIT) {
1238112382
return BAD_LENGTH_E;
1238212383
}
1238312384

0 commit comments

Comments
 (0)