Skip to content

Commit

Permalink
scan-build: CI Fail if scan-build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdeep1 committed Jul 22, 2024
1 parent 8b2fb39 commit 4851806
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions src/coap_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -3150,8 +3150,13 @@ coap_handle_request_put_block(coap_context_t *context,
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");
Expand Down
2 changes: 1 addition & 1 deletion src/coap_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit 4851806

Please sign in to comment.