Confirm ssl->hsHashes is not NULL before attempting to dereference it.

This commit is contained in:
Kareem
2022-05-27 10:57:23 -07:00
parent f93b23b524
commit 98ec442b37

View File

@@ -14341,7 +14341,7 @@ static int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
#endif
{
ssl->options.cacheMessages = 0;
if (ssl->hsHashes->messages != NULL) {
if ((ssl->hsHashes != NULL) && (ssl->hsHashes->messages != NULL)) {
XFREE(ssl->hsHashes->messages, ssl->heap,
DYNAMIC_TYPE_HASHES);
ssl->hsHashes->messages = NULL;
@@ -14427,7 +14427,7 @@ static int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
#endif
{
ssl->options.cacheMessages = 0;
if (ssl->hsHashes->messages != NULL) {
if ((ssl->hsHashes != NULL) && (ssl->hsHashes->messages != NULL)) {
XFREE(ssl->hsHashes->messages, ssl->heap, DYNAMIC_TYPE_HASHES);
ssl->hsHashes->messages = NULL;
}