1. Added a couple missing checks for NULL pointers in DTLS code.

2. Fixed compiler warning under Windows.
This commit is contained in:
John Safranek 2013-10-08 14:59:59 -07:00
parent 33bcc76a07
commit 51c485f523

View File

@ -2073,8 +2073,10 @@ DtlsMsg* DtlsMsgStore(DtlsMsg* head, word32 seq, const byte* data,
DtlsMsg* cur = DtlsMsgFind(head, seq);
if (cur == NULL) {
cur = DtlsMsgNew(dataSz, heap);
DtlsMsgSet(cur, seq, data, type, fragOffset, fragSz);
head = DtlsMsgInsert(head, cur);
if (cur != NULL) {
DtlsMsgSet(cur, seq, data, type, fragOffset, fragSz);
head = DtlsMsgInsert(head, cur);
}
}
else {
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);
*inOutIdx += fragSz;
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);
}
else {
@ -7654,6 +7657,8 @@ static void PickHashSigAlgo(CYASSL* ssl,
int ret = 0;
byte doUserRsa = 0;
(void)doUserRsa;
#ifdef HAVE_PK_CALLBACKS
#ifndef NO_RSA
if (ssl->ctx->RsaEncCb)