From 66064ad778806d802f63f4791ffde006a6645572 Mon Sep 17 00:00:00 2001 From: kris Date: Fri, 16 Nov 2007 03:14:59 +0000 Subject: [PATCH] Fixing another possible NULL dereference, this time in readTraceResponses() in traceroute.cc. Any replies at all are apparently counted below this section of code, and there is no else case to go with this if and else if, so I figure I'll just let it go false so it goes along with any other abnormal responses. Found with Coverity, CID 28. --- traceroute.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/traceroute.cc b/traceroute.cc index 61fd3bf7e..6ae05bcc8 100644 --- a/traceroute.cc +++ b/traceroute.cc @@ -444,7 +444,7 @@ Traceroute::readTraceResponses () { if (tp->ipreplysrc.s_addr) break; - if ((tg->proto == IPPROTO_UDP && ip2->ip_p == IPPROTO_UDP) || + if ((tg->proto == IPPROTO_UDP && (ip2 && ip2->ip_p == IPPROTO_UDP)) || (icmp->icmp_type == ICMP_DEST_UNREACH)) { switch (icmp->icmp_code) { /* reply from a closed port */