From 988db6923d65dc183819c1a6f9436245b4a5c898 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Thu, 12 Oct 2023 16:23:53 +0200 Subject: [PATCH] gnrc_ipv6_ext_frag: _completed: Add comment why list head is not checked ... for NULL pointer dereference. --- sys/net/gnrc/network_layer/ipv6/ext/frag/gnrc_ipv6_ext_frag.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/gnrc/network_layer/ipv6/ext/frag/gnrc_ipv6_ext_frag.c b/sys/net/gnrc/network_layer/ipv6/ext/frag/gnrc_ipv6_ext_frag.c index 2f5124363c..c57407729e 100644 --- a/sys/net/gnrc/network_layer/ipv6/ext/frag/gnrc_ipv6_ext_frag.c +++ b/sys/net/gnrc/network_layer/ipv6/ext/frag/gnrc_ipv6_ext_frag.c @@ -711,6 +711,7 @@ static gnrc_pktsnip_t *_completed(gnrc_ipv6_ext_frag_rbuf_t *rbuf) /* clist: first element is second element ;-) (from next of head) */ gnrc_ipv6_ext_frag_limits_t *ptr = (gnrc_ipv6_ext_frag_limits_t *)rbuf->limits.next->next; + /* ptr should not be NULL at this point so it is safe to dereference with ptr->start here */ if (rbuf->last && (ptr->start == 0)) { gnrc_pktsnip_t *res = NULL;