Skip to content

Commit c14343a

Browse files
valgrind and coverity reported errors fixed. (ARMmbed#1838)
Coverity CID: 277994 fixed.
1 parent 9b14b83 commit c14343a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

source/6LoWPAN/Thread/thread_extension.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,8 +626,11 @@ void thread_extension_address_registration(struct protocol_interface_info_entry
626626
void thread_extension_dua_address_generate(protocol_interface_info_entry_t *cur, uint8_t *domain_prefix, uint8_t domain_prefix_len)
627627
{
628628
if_address_entry_t *def_address = NULL;
629-
addr_delete_matching(cur, NULL, 0, ADDR_SOURCE_THREAD_DOMAIN);
630629
uint8_t domain_address[16];
630+
if (!thread_extension_version_check(thread_info(cur)->version)) {
631+
return;
632+
}
633+
addr_delete_matching(cur, NULL, 0, ADDR_SOURCE_THREAD_DOMAIN);
631634
memcpy(domain_address, domain_prefix, 8);
632635
def_address = icmpv6_slaac_address_add(cur, domain_address, domain_prefix_len, 0xffffffff, 0xffffffff, true, SLAAC_IID_DEFAULT);
633636
if (def_address) {

source/6LoWPAN/Thread/thread_extension_bbr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,9 @@ static int thread_extension_bbr_dua_cb(int8_t service_id, uint8_t source_address
873873
}
874874
*/
875875
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(this->interface_id);
876+
if (!cur) {
877+
return -1;
878+
}
876879
if (0 == thread_extension_primary_bbr_get(cur, bbr_rloc_addr, NULL, NULL, NULL) &&
877880
!addr_get_entry(cur,bbr_rloc_addr)) {
878881
// Primary pBBR present and I am not the pBBR

0 commit comments

Comments
 (0)