mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Fixing another possible NULL dereference, in getTracePort() in traceroute.cc. Found with Coverity, CID 29
This commit is contained in:
parent
ad7b6e416b
commit
477214a779
1 changed files with 6 additions and 1 deletions
|
|
@ -326,6 +326,7 @@ Traceroute::getTracePort (u8 proto, Target * t) {
|
|||
u16 filtered_port = 1;
|
||||
u16 state = 0;
|
||||
u16 port = 0;
|
||||
struct Port *np;
|
||||
|
||||
/* Use the first specified port for ping traceroutes */
|
||||
if (o.pingscan) {
|
||||
|
|
@ -360,7 +361,11 @@ Traceroute::getTracePort (u8 proto, Target * t) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
port = t->ports.nextPort (NULL, proto, state)->portno;
|
||||
np = t->ports.nextPort (NULL, proto, state);
|
||||
if (!np)
|
||||
return -1;
|
||||
|
||||
port = np->portno;
|
||||
|
||||
/* If this is a protocol scan traceroute and we are using
|
||||
* one of the major protocols, set up the required information
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue