You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/11/30 13:56:16 UTC

[GitHub] [mynewt-nimble] sjanc commented on a change in pull request #1111: Fix Coverity issues in mesh

sjanc commented on a change in pull request #1111:
URL: https://github.com/apache/mynewt-nimble/pull/1111#discussion_r759301591



##########
File path: nimble/host/mesh/include/mesh/glue.h
##########
@@ -566,8 +566,12 @@ static inline void k_sem_init(struct k_sem *sem, unsigned int initial_count,
 static inline int k_sem_take(struct k_sem *sem, int32_t timeout)
 {
 	uint32_t ticks;
+	int rc;
 
-	ble_npl_time_ms_to_ticks(timeout, &ticks);
+	rc = ble_npl_time_ms_to_ticks(timeout, &ticks);
+	if (rc) {
+		assert(0);

Review comment:
       can't we just return error here?

##########
File path: nimble/host/mesh/src/proxy_srv.c
##########
@@ -429,7 +431,7 @@ static int node_id_adv(struct bt_mesh_subnet *sub, int32_t duration)
 	memcpy(proxy_svc_data + 3, tmp + 8, 8);
 
 	err = bt_mesh_adv_start(&fast_adv_param, duration, node_id_ad,
-			      ARRAY_SIZE(node_id_ad), sd, 0);
+                            ARRAY_SIZE(node_id_ad), sd, sd_len);

Review comment:
       couldn't this just accept NULL instead?

##########
File path: nimble/host/mesh/src/testing.c
##########
@@ -123,7 +123,7 @@ void bt_test_print_credentials(void)
 	console_printf("IV Index: %08lx\n", (long) bt_mesh.iv_index);
 	console_printf("Dev key: %s\n", bt_hex(bt_mesh.dev_key, 16));
 
-	for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.app_keys); ++i)
+	for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.subnets); ++i)

Review comment:
       this looks kinda odd,   subnets here, but in loop app_key arrays is accessed
   
   are lines 128-131 correct?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org