From ecba5161acbe445a92a22ace3573f3d336b335e2 Mon Sep 17 00:00:00 2001 From: Nickolas Lapp Date: Fri, 6 May 2016 13:15:21 -0600 Subject: [PATCH] default copyInto static instead of dynamic --- src/ssl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ssl.c b/src/ssl.c index e21935202..84582581d 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -7070,6 +7070,13 @@ int GetDeepCopySession(WOLFSSL* ssl, WOLFSSL_SESSION* copyFrom) #endif *copyInto = *copyFrom; + + /* Default ticket to non dynamic. This will avoid crash if we fail below */ +#ifdef HAVE_SESSION_TICKET + copyInto->ticket = copyInto->staticTicket; + copyInto->isDynamic = 0; +#endif + if (UnLockMutex(&session_mutex) != 0) { return BAD_MUTEX_E; } @@ -7095,6 +7102,7 @@ int GetDeepCopySession(WOLFSSL* ssl, WOLFSSL_SESSION* copyFrom) if (ret == SSL_SUCCESS) { copyInto->ticket = tmpBuff; + copyInto->isDynamic = 1; XMEMCPY(copyInto->ticket, copyFrom->ticket, ticketLen); } } else {