Skip to content

Commit 64e924e

Browse files
author
Arto Kinnunen
authored
Check object before usage (#2036)
Avoid potential crash by checking object availability before using it
1 parent 2d7e923 commit 64e924e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

source/6LoWPAN/Thread/thread_extension_bbr.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,9 +1529,13 @@ void thread_extension_bbr_status_override_set(uint8_t dua_status, uint8_t dua_co
15291529
void thread_extension_bbr_mcast_fwd_check(int8_t interface_id, bool *multicast_fwd)
15301530
{
15311531
thread_pbbr_t *this = thread_bbr_find_by_interface(interface_id);
1532-
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(this->interface_id);
15331532

1534-
if (!cur || !this || multicast_fwd) {
1533+
if (!this || multicast_fwd) {
1534+
return;
1535+
}
1536+
1537+
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(this->interface_id);
1538+
if (!cur) {
15351539
return;
15361540
}
15371541

0 commit comments

Comments
 (0)