Merge pull request #5187 from kareem-wolfssl/hsHashesNull

Confirm ssl->hsHashes is not NULL before attempting to dereference it.
This commit is contained in:
David Garske
2022-05-30 10:41:35 -07:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -14369,7 +14369,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;
@@ -14455,7 +14455,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;
}

View File

@@ -164,7 +164,7 @@ WOLFSSL_API int wolfSSL_ASN1_item_i2d(const void *src, byte **dest,
const WOLFSSL_ASN1_ITEM *tpl);
/* Need function declaration otherwise compiler complains */
// NOLINTBEGIN(readability-named-parameter)
/* // NOLINTBEGIN(readability-named-parameter) */
#define IMPLEMENT_ASN1_FUNCTIONS(type) \
type *type##_new(void); \
type *type##_new(void){ \
@@ -179,7 +179,7 @@ WOLFSSL_API int wolfSSL_ASN1_item_i2d(const void *src, byte **dest,
{ \
return wolfSSL_ASN1_item_i2d(src, dest, &type##_template_data);\
}
// NOLINTEND(readability-named-parameter)
/* // NOLINTEND(readability-named-parameter) */
#endif /* OPENSSL_ALL */