@@ -2275,6 +2275,7 @@ struct bt_mesh_comp_p0_elem *bt_mesh_comp_p0_elem_pull(const struct bt_mesh_comp
2275
2275
size_t modlist_size ;
2276
2276
2277
2277
if (page -> _buf -> len < 4 ) {
2278
+ LOG_DBG ("Buffer is too short" );
2278
2279
return NULL ;
2279
2280
}
2280
2281
@@ -2285,6 +2286,7 @@ struct bt_mesh_comp_p0_elem *bt_mesh_comp_p0_elem_pull(const struct bt_mesh_comp
2285
2286
modlist_size = elem -> nsig * 2 + elem -> nvnd * 4 ;
2286
2287
2287
2288
if (page -> _buf -> len < modlist_size ) {
2289
+ LOG_DBG ("Buffer is shorter than number of claimed models" );
2288
2290
return NULL ;
2289
2291
}
2290
2292
@@ -2321,7 +2323,7 @@ struct bt_mesh_comp_p1_elem *bt_mesh_comp_p1_elem_pull(struct net_buf_simple *bu
2321
2323
struct bt_mesh_comp_p1_elem * elem )
2322
2324
{
2323
2325
if (buf -> len < 4 ) {
2324
- LOG_DBG ("No more elements to pull or missing data " );
2326
+ LOG_DBG ("Buffer is too short " );
2325
2327
return NULL ;
2326
2328
}
2327
2329
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
2333
2335
elem -> nvnd = net_buf_simple_pull_u8 (buf );
2334
2336
for (i = 0 ; i < elem -> nsig + elem -> nvnd ; i ++ ) {
2335
2337
if (buf -> len < elem_size + 1 ) {
2338
+ LOG_DBG ("Buffer is shorter than number of claimed models" );
2336
2339
return NULL ;
2337
2340
}
2338
2341
@@ -2351,6 +2354,7 @@ struct bt_mesh_comp_p1_elem *bt_mesh_comp_p1_elem_pull(struct net_buf_simple *bu
2351
2354
}
2352
2355
2353
2356
if (buf -> len < elem_size ) {
2357
+ LOG_DBG ("No more elements to pull or missing data" );
2354
2358
return NULL ;
2355
2359
}
2356
2360
@@ -2381,13 +2385,15 @@ struct bt_mesh_comp_p1_model_item *bt_mesh_comp_p1_item_pull(
2381
2385
item_size = item -> ext_item_cnt * (item -> format + 1 );
2382
2386
if (item -> cor_present ) {
2383
2387
if (elem -> _buf -> len < 1 ) {
2388
+ LOG_DBG ("Coresponding_Present field is claimed but not present" );
2384
2389
return NULL ;
2385
2390
}
2386
2391
2387
2392
item -> cor_id = net_buf_simple_pull_u8 (elem -> _buf );
2388
2393
}
2389
2394
2390
2395
if (elem -> _buf -> len < item_size ) {
2396
+ LOG_DBG ("No more elements to pull or missing data" );
2391
2397
return NULL ;
2392
2398
}
2393
2399
0 commit comments