From bc54f8bac36bd8e97d36824146b11d3c72e1f8a1 Mon Sep 17 00:00:00 2001 From: Yasuyuki Tanaka Date: Sat, 21 May 2016 11:55:07 +0200 Subject: [PATCH] Orchestra: add NULL checks into new_time_source (eb-per-time-source) --- apps/orchestra/orchestra-rule-eb-per-time-source.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/orchestra/orchestra-rule-eb-per-time-source.c b/apps/orchestra/orchestra-rule-eb-per-time-source.c index b18617f0a..ed037291b 100644 --- a/apps/orchestra/orchestra-rule-eb-per-time-source.c +++ b/apps/orchestra/orchestra-rule-eb-per-time-source.c @@ -74,8 +74,8 @@ select_packet(uint16_t *slotframe, uint16_t *timeslot) static void new_time_source(const struct tsch_neighbor *old, const struct tsch_neighbor *new) { - uint16_t old_ts = get_node_timeslot(&old->addr); - uint16_t new_ts = get_node_timeslot(&new->addr); + uint16_t old_ts = old != NULL ? get_node_timeslot(&old->addr) : 0xffff; + uint16_t new_ts = new != NULL ? get_node_timeslot(&new->addr) : 0xffff; if(new_ts == old_ts) { return;