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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user