From: Guus Sliepen Date: Sun, 14 Dec 2014 11:42:03 +0000 (+0100) Subject: Fix segfault when receiving UDP packets with an unknown source address. X-Git-Tag: release-1.1pre11~20 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=558b19c2432d938afc4a659668bd461ace6ed744;p=tinc Fix segfault when receiving UDP packets with an unknown source address. --- diff --git a/src/net_packet.c b/src/net_packet.c index a01b6359..a24a7add 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -1056,7 +1056,7 @@ void handle_incoming_vpn_data(void *data, int flags) { // It might be from a 1.1 node, which might have a source ID in the packet. from = lookup_node_id(&spkt->srcid); if(from && !memcmp(&spkt->dstid, &nullid, sizeof nullid) && from->status.sptps) { - if(sptps_verify_datagram(&n->sptps, spkt->data, spkt->len - sizeof(spkt->srcid) - sizeof(spkt->dstid))) + if(sptps_verify_datagram(&from->sptps, spkt->data, spkt->len - sizeof(spkt->srcid) - sizeof(spkt->dstid))) n = from; else goto skip_harder;