diff --git a/FPEngine.cc b/FPEngine.cc index f7488c355..72fcb6fd8 100644 --- a/FPEngine.cc +++ b/FPEngine.cc @@ -1366,7 +1366,9 @@ int FPHost::choose_osscan_ports() { if ((tport = this->target_host->ports.nextPort(tport, &port, IPPROTO_TCP, PORT_OPEN))) this->open_port_tcp = tport->portno; } - this->target_host->FPR->osscan_opentcpport = this->open_port_tcp; + if (this->target_host->FPR != NULL) { + this->target_host->FPR->osscan_opentcpport = this->open_port_tcp; + } } else { /* If we don't have an open port, set it to -1 so we don't send probes that * target TCP open ports */ @@ -1382,7 +1384,9 @@ int FPHost::choose_osscan_ports() { if (tport->portno == 0) if ((tport = this->target_host->ports.nextPort(tport, &port, IPPROTO_TCP, PORT_CLOSED))) this->closed_port_tcp = tport->portno; - this->target_host->FPR->osscan_closedtcpport = this->closed_port_tcp; + if (this->target_host->FPR != NULL) { + this->target_host->FPR->osscan_closedtcpport = this->closed_port_tcp; + } } else if ((tport = this->target_host->ports.nextPort(NULL, &port, IPPROTO_TCP, PORT_UNFILTERED))) { /* Well, we will settle for unfiltered */ this->closed_port_tcp = tport->portno; @@ -1405,7 +1409,9 @@ int FPHost::choose_osscan_ports() { if (tport->portno == 0) if ((tport = this->target_host->ports.nextPort(tport, &port, IPPROTO_UDP, PORT_CLOSED))) this->closed_port_udp = tport->portno; - this->target_host->FPR->osscan_closedudpport = this->closed_port_udp; + if (this->target_host->FPR != NULL) { + this->target_host->FPR->osscan_closedudpport = this->closed_port_udp; + } } else if ((tport = this->target_host->ports.nextPort(NULL, &port, IPPROTO_UDP, PORT_UNFILTERED))) { /* Well, we will settle for unfiltered */ this->closed_port_udp = tport->portno; diff --git a/nmap_dns.cc b/nmap_dns.cc index 22d6a375f..d075abf63 100644 --- a/nmap_dns.cc +++ b/nmap_dns.cc @@ -499,6 +499,7 @@ static void do_possible_writes() { servI->to_process.pop_front(); } else if (!new_reqs.empty()) { tpreq = new_reqs.front(); + assert(tpreq != NULL); tpreq->first_server = tpreq->curr_server = &*servI; new_reqs.pop_front(); } diff --git a/nsock/src/nsock_core.c b/nsock/src/nsock_core.c index fc48f7443..ed4e8b87f 100644 --- a/nsock/src/nsock_core.c +++ b/nsock/src/nsock_core.c @@ -322,6 +322,7 @@ void handle_connect_result(struct npool *ms, struct nevent *nse, enum nse_status int optval; socklen_t optlen = sizeof(int); struct niod *iod = nse->iod; + assert(iod != NULL); #if HAVE_OPENSSL int sslerr; int rc = 0; diff --git a/nsock/src/nsock_proxy.c b/nsock/src/nsock_proxy.c index 185771d88..cddcb70cf 100644 --- a/nsock/src/nsock_proxy.c +++ b/nsock/src/nsock_proxy.c @@ -139,6 +139,7 @@ void nsock_proxychain_delete(nsock_proxychain chain) { int nsock_pool_set_proxychain(nsock_pool nspool, nsock_proxychain chain) { struct npool *nsp = (struct npool *)nspool; + assert(nsp != NULL); if (nsp && nsp->px_chain) { nsock_log_error("Invalid call. Existing proxychain on this nsock_pool");