From: Guus Sliepen Date: Wed, 10 Nov 2004 18:10:59 +0000 (+0000) Subject: Missing check for NULL-pointer. X-Git-Tag: import-tinc-1.1~760 X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=e8b11b1cca11f7f50542a7b34f4251f43447db0d;p=meshlink Missing check for NULL-pointer. --- diff --git a/src/route.c b/src/route.c index bf13f448..42ae1fdf 100644 --- a/src/route.c +++ b/src/route.c @@ -346,7 +346,7 @@ static __inline__ void route_ipv4_unicast(node_t *source, vpn_packet_t *packet) via = (subnet->owner->via == myself) ? subnet->owner->nexthop : subnet->owner->via; - if(packet->len > via->mtu && via != myself) { + if(via && packet->len > via->mtu && via != myself) { ifdebug(TRAFFIC) logger(LOG_INFO, _("Packet for %s (%s) length %d larger than MTU %d"), subnet->owner->name, subnet->owner->hostname, packet->len, via->mtu); if(packet->data[20] & 0x40) { packet->len = via->mtu; @@ -485,7 +485,7 @@ static __inline__ void route_ipv6_unicast(node_t *source, vpn_packet_t *packet) via = (subnet->owner->via == myself) ? subnet->owner->nexthop : subnet->owner->via; - if(packet->len > via->mtu && via != myself) { + if(via && packet->len > via->mtu && via != myself) { ifdebug(TRAFFIC) logger(LOG_INFO, _("Packet for %s (%s) length %d larger than MTU %d"), subnet->owner->name, subnet->owner->hostname, packet->len, via->mtu); packet->len = via->mtu; route_ipv6_unreachable(source, packet, ICMP6_PACKET_TOO_BIG, 0);