diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6483ab2f..e2c7d6f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: - name: check run: | ./configure --disable-documentation --disable-doxygen --disable-man --enable-examples --enable-tests --disable-dtls - scan-build make V=0 + scan-build --status-bugs make V=0 check-missing-updates: runs-on: ubuntu-latest steps: diff --git a/src/coap_block.c b/src/coap_block.c index eb4848a1..d4edf294 100644 --- a/src/coap_block.c +++ b/src/coap_block.c @@ -3150,8 +3150,13 @@ give_app_data: lg_srcv->observe_length, lg_srcv->observe); } coap_remove_option(pdu, block_option); - pdu->body_data = lg_srcv->body_data->s; - pdu->body_length = lg_srcv->total_len; + if (lg_srcv->body_data) { + pdu->body_data = lg_srcv->body_data->s; + pdu->body_length = lg_srcv->total_len; + } else { + pdu->body_data = NULL; + pdu->body_length = 0; + } pdu->body_offset = 0; pdu->body_total = lg_srcv->total_len; coap_log_debug("Server app version of updated PDU\n"); diff --git a/src/coap_net.c b/src/coap_net.c index e638b11a..5827a023 100644 --- a/src/coap_net.c +++ b/src/coap_net.c @@ -205,7 +205,6 @@ coap_delete_node(coap_queue_t *node) { int ret; #if COAP_THREAD_SAFE coap_context_t *context; - (void)context; #endif /* COAP_THREAD_SAFE */ if (!node) @@ -216,6 +215,7 @@ coap_delete_node(coap_queue_t *node) { #if COAP_THREAD_SAFE /* Keep copy as node will be going away */ context = node->session->context; + (void)context; #endif /* COAP_THREAD_SAFE */ coap_lock_lock(context, return 0); ret = coap_delete_node_lkd(node);