1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-16 04:39:03 +00:00

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.

This commit is contained in:
kris
2007-11-16 03:14:59 +00:00
parent 7f1654e3ac
commit 66064ad778

View File

@@ -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 */