Coverity: Fix scan issues

Fixes

CID 1502435:
CID 1502432:
CID 1502423:

False Positives

CID 1502434:  Cant see why code is not reached
CID 1502433:  Could make blk_size uint8_t:3 I guess.
CID 1502430:  Dont know why it is complaining
CID 1502427:
CID 1502426:  Code looks fine to me - context->session could be set.
CID 1502424:

Fixed by other PRs

CID 1502422: #610
CID 1502431: #610
CID 1502428: #610
CID 1502429: #587 with my additional fixes
This commit is contained in:
Jon Shallow committed 2021-03-17 11:17:18 +00:00
1 parent ae752e9e7a
commit 74342abe4d
4 files changed
+9 -3

No files matched your search

+5 -1
View File
@@ -140,7 +140,11 @@ coap_new_cache_entry(coap_session_t *session, const coap_pdu_t *pdu,
if (record_pdu == COAP_CACHE_RECORD_PDU) {
entry->pdu = coap_pdu_init(pdu->type, pdu->code, pdu->tid, pdu->alloc_size);
if (entry->pdu) {
coap_pdu_resize(entry->pdu, pdu->alloc_size);
if (!coap_pdu_resize(entry->pdu, pdu->alloc_size)) {
coap_delete_pdu(entry->pdu);
coap_free_type(COAP_CACHE_ENTRY, entry);
return NULL;
}
/* Need to get the appropriate data across */
memcpy(entry->pdu, pdu, offsetof(coap_pdu_t, token));
memcpy(entry->pdu->token, pdu->token, pdu->used_size);