Skip to content

Commit

Permalink
Merge pull request #2178 from cgundogan/ip_fix_null_check
Browse files Browse the repository at this point in the history
ip: check for null before ip_get_next_hop is used
  • Loading branch information
LudwigKnuepfer committed Dec 11, 2014
2 parents 0d6bc7e + 2a7ce79 commit 40264b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sys/net/network_layer/sixlowpan/ip.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,13 @@ int ipv6_send_packet(ipv6_hdr_t *packet, ipv6_addr_t *next_hop)

if (next_hop == NULL) {
DEBUG("Trying to find the next hop for %s\n", ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, &packet->destaddr));
ipv6_addr_t *dest = ip_get_next_hop(&packet->destaddr);

if (ip_get_next_hop == NULL) {
return -1;
}

ipv6_addr_t *dest = ip_get_next_hop(&packet->destaddr);

if (dest == NULL) {
return -1;
}
Expand Down

0 comments on commit 40264b4

Please sign in to comment.