From 9e5c188b3bacaf4f17e52ee777c50da1c8b8c371 Mon Sep 17 00:00:00 2001 From: Yonezawa-T2 Date: Mon, 16 Nov 2015 16:36:30 +0900 Subject: [PATCH] gnrc_ipv6_netif: fixed buffer overrun --- sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c b/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c index 3867fa369c79d..1fbcc47e8c3ed 100644 --- a/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c +++ b/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c @@ -745,7 +745,7 @@ static ipv6_addr_t *_source_address_selection(gnrc_ipv6_netif_t *iface, const ip } /* reset candidate set to mark winners */ - memset(candidate_set, 0, (GNRC_IPV6_NETIF_ADDR_NUMOF / 8) + 1); + memset(candidate_set, 0, (GNRC_IPV6_NETIF_ADDR_NUMOF + 7) / 8); /* check if we have a clear winner */ /* collect candidates with maximum points */ for (int i = 0; i < GNRC_IPV6_NETIF_ADDR_NUMOF; i++) {