Skip to content

Commit 9a0c18c

Browse files
Work around error: enumerated and non-enumerated type in conditional expression
1 parent 0463e37 commit 9a0c18c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/internal.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34824,7 +34824,7 @@ int SendCertificateVerify(WOLFSSL* ssl)
3482434824
#ifdef HAVE_SESSION_TICKET
3482534825
int SetTicket(WOLFSSL* ssl, const byte* ticket, word32 length)
3482634826
{
34827-
word32 sessIdLen = (length >= ID_LEN) ? ID_LEN : length;
34827+
word32 sessIdLen = 0;
3482834828

3482934829
if (!HaveUniqueSessionObj(ssl))
3483034830
return MEMORY_ERROR;
@@ -34847,6 +34847,10 @@ int SetTicket(WOLFSSL* ssl, const byte* ticket, word32 length)
3484734847
ssl->session->ticketLen = (word16)length;
3484834848

3484934849
if (length > 0) {
34850+
if (length >= ID_LEN)
34851+
sessIdLen = ID_LEN;
34852+
else
34853+
sessIdLen = length;
3485034854
XMEMCPY(ssl->session->ticket, ticket, length);
3485134855
if (ssl->session_ticket_cb != NULL) {
3485234856
ssl->session_ticket_cb(ssl,

0 commit comments

Comments
 (0)