mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 12:44:45 +02:00
1. Added a couple missing checks for NULL pointers in DTLS code.
2. Fixed compiler warning under Windows.
This commit is contained in:
@@ -2073,9 +2073,11 @@ DtlsMsg* DtlsMsgStore(DtlsMsg* head, word32 seq, const byte* data,
|
|||||||
DtlsMsg* cur = DtlsMsgFind(head, seq);
|
DtlsMsg* cur = DtlsMsgFind(head, seq);
|
||||||
if (cur == NULL) {
|
if (cur == NULL) {
|
||||||
cur = DtlsMsgNew(dataSz, heap);
|
cur = DtlsMsgNew(dataSz, heap);
|
||||||
|
if (cur != NULL) {
|
||||||
DtlsMsgSet(cur, seq, data, type, fragOffset, fragSz);
|
DtlsMsgSet(cur, seq, data, type, fragOffset, fragSz);
|
||||||
head = DtlsMsgInsert(head, cur);
|
head = DtlsMsgInsert(head, cur);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
DtlsMsgSet(cur, seq, data, type, fragOffset, fragSz);
|
DtlsMsgSet(cur, seq, data, type, fragOffset, fragSz);
|
||||||
}
|
}
|
||||||
@@ -3742,7 +3744,8 @@ static int DoDtlsHandShakeMsg(CYASSL* ssl, byte* input, word32* inOutIdx,
|
|||||||
size, type, fragOffset, fragSz, ssl->heap);
|
size, type, fragOffset, fragSz, ssl->heap);
|
||||||
*inOutIdx += fragSz;
|
*inOutIdx += fragSz;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
if (ssl->dtls_msg_list->fragSz >= ssl->dtls_msg_list->sz)
|
if (ssl->dtls_msg_list != NULL &&
|
||||||
|
ssl->dtls_msg_list->fragSz >= ssl->dtls_msg_list->sz)
|
||||||
ret = DtlsMsgDrain(ssl);
|
ret = DtlsMsgDrain(ssl);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -7654,6 +7657,8 @@ static void PickHashSigAlgo(CYASSL* ssl,
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
byte doUserRsa = 0;
|
byte doUserRsa = 0;
|
||||||
|
|
||||||
|
(void)doUserRsa;
|
||||||
|
|
||||||
#ifdef HAVE_PK_CALLBACKS
|
#ifdef HAVE_PK_CALLBACKS
|
||||||
#ifndef NO_RSA
|
#ifndef NO_RSA
|
||||||
if (ssl->ctx->RsaEncCb)
|
if (ssl->ctx->RsaEncCb)
|
||||||
|
Reference in New Issue
Block a user