Skip to content

Commit

Permalink
Merge pull request #4534 from Yonezawa-T2/gnrc_off_by_1_overrun
Browse files Browse the repository at this point in the history
gnrc_ipv6_netif: fixed buffer overrun
  • Loading branch information
miri64 committed Dec 22, 2015
2 parents 5b4ef43 + 08ba1f8 commit 34974ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 34974ab

Please sign in to comment.