From 0ba9fd3456b043d60907485454303288a012543e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Sun, 2 Apr 2017 18:40:58 +0200 Subject: [PATCH] 6lo: Avoid null ptr dereference when DAC=1, DAM=00, M=1 --- sys/net/gnrc/network_layer/sixlowpan/iphc/gnrc_sixlowpan_iphc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/gnrc/network_layer/sixlowpan/iphc/gnrc_sixlowpan_iphc.c b/sys/net/gnrc/network_layer/sixlowpan/iphc/gnrc_sixlowpan_iphc.c index 565e8afec6..25087dc389 100644 --- a/sys/net/gnrc/network_layer/sixlowpan/iphc/gnrc_sixlowpan_iphc.c +++ b/sys/net/gnrc/network_layer/sixlowpan/iphc/gnrc_sixlowpan_iphc.c @@ -367,7 +367,7 @@ size_t gnrc_sixlowpan_iphc_decode(gnrc_pktsnip_t **dec_hdr, gnrc_pktsnip_t *pkt, dci = iphc_hdr[CID_EXT_IDX] & 0x0f; } - if (iphc_hdr[IPHC2_IDX] & SIXLOWPAN_IPHC2_DAM) { + if (iphc_hdr[IPHC2_IDX] & (SIXLOWPAN_IPHC2_M | SIXLOWPAN_IPHC2_DAM)) { ctx = gnrc_sixlowpan_ctx_lookup_id(dci); if (ctx == NULL) {