From 95766d71ac5474005b41be47360d7b7b9547f079 Mon Sep 17 00:00:00 2001 From: int_szyk Date: Tue, 24 Sep 2019 12:53:53 +0200 Subject: [PATCH] thread_mle_message_handler: fix null comparison. Fixes Coverity issue about comparing nullptr. --- .../source/6LoWPAN/Thread/thread_mle_message_handler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/Thread/thread_mle_message_handler.c b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/Thread/thread_mle_message_handler.c index 68df5ed719..a8253c5f8e 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/Thread/thread_mle_message_handler.c +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/Thread/thread_mle_message_handler.c @@ -514,7 +514,7 @@ static void thread_parse_annoucement(protocol_interface_info_entry_t *cur, mle_m channel_page = ptr[0]; channel = common_read_16_bit(&ptr[1]); - if (linkConfiguration->timestamp == timestamp) { + if (linkConfiguration && linkConfiguration->timestamp == timestamp) { // We received same timestamp tr_debug("Same timestamp"); return; @@ -527,7 +527,7 @@ static void thread_parse_annoucement(protocol_interface_info_entry_t *cur, mle_m } - if (linkConfiguration->timestamp > timestamp) { + if (linkConfiguration && linkConfiguration->timestamp > timestamp) { // We received older time stamp we just announce back to originator channel thread_bootstrap_announce_send(cur, linkConfiguration->channel_page, linkConfiguration->rfChannel, linkConfiguration->panId, linkConfiguration->timestamp, channel); return;