@@ -2275,6 +2275,7 @@ struct bt_mesh_comp_p0_elem *bt_mesh_comp_p0_elem_pull(const struct bt_mesh_comp
22752275 size_t modlist_size ;
22762276
22772277 if (page -> _buf -> len < 4 ) {
2278+ LOG_DBG ("Buffer is too short" );
22782279 return NULL ;
22792280 }
22802281
@@ -2285,6 +2286,7 @@ struct bt_mesh_comp_p0_elem *bt_mesh_comp_p0_elem_pull(const struct bt_mesh_comp
22852286 modlist_size = elem -> nsig * 2 + elem -> nvnd * 4 ;
22862287
22872288 if (page -> _buf -> len < modlist_size ) {
2289+ LOG_DBG ("Buffer is shorter than number of claimed models" );
22882290 return NULL ;
22892291 }
22902292
@@ -2321,7 +2323,7 @@ struct bt_mesh_comp_p1_elem *bt_mesh_comp_p1_elem_pull(struct net_buf_simple *bu
23212323 struct bt_mesh_comp_p1_elem * elem )
23222324{
23232325 if (buf -> len < 4 ) {
2324- LOG_DBG ("No more elements to pull or missing data " );
2326+ LOG_DBG ("Buffer is too short " );
23252327 return NULL ;
23262328 }
23272329 size_t elem_size = 0 ;
@@ -2333,6 +2335,7 @@ struct bt_mesh_comp_p1_elem *bt_mesh_comp_p1_elem_pull(struct net_buf_simple *bu
23332335 elem -> nvnd = net_buf_simple_pull_u8 (buf );
23342336 for (i = 0 ; i < elem -> nsig + elem -> nvnd ; i ++ ) {
23352337 if (buf -> len < elem_size + 1 ) {
2338+ LOG_DBG ("Buffer is shorter than number of claimed models" );
23362339 return NULL ;
23372340 }
23382341
@@ -2351,6 +2354,7 @@ struct bt_mesh_comp_p1_elem *bt_mesh_comp_p1_elem_pull(struct net_buf_simple *bu
23512354 }
23522355
23532356 if (buf -> len < elem_size ) {
2357+ LOG_DBG ("No more elements to pull or missing data" );
23542358 return NULL ;
23552359 }
23562360
@@ -2381,13 +2385,15 @@ struct bt_mesh_comp_p1_model_item *bt_mesh_comp_p1_item_pull(
23812385 item_size = item -> ext_item_cnt * (item -> format + 1 );
23822386 if (item -> cor_present ) {
23832387 if (elem -> _buf -> len < 1 ) {
2388+ LOG_DBG ("Coresponding_Present field is claimed but not present" );
23842389 return NULL ;
23852390 }
23862391
23872392 item -> cor_id = net_buf_simple_pull_u8 (elem -> _buf );
23882393 }
23892394
23902395 if (elem -> _buf -> len < item_size ) {
2396+ LOG_DBG ("No more elements to pull or missing data" );
23912397 return NULL ;
23922398 }
23932399
0 commit comments