mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
merge soc07 r4862 - Rearrange some reason-setting code to avoid using deallocated memory.
This commit is contained in:
parent
5e3bb361f2
commit
87840c36de
2 changed files with 3 additions and 3 deletions
|
|
@ -147,7 +147,7 @@ static void state_reason_summary_dinit(state_reason_summary_t *r) {
|
|||
while(r != NULL) {
|
||||
tmp = r->next;
|
||||
free(r);
|
||||
r = r->next;
|
||||
r = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2688,8 +2688,8 @@ static bool do_one_select_round(UltraScanInfo *USI, struct timeval *stime) {
|
|||
if (probe->isPing())
|
||||
ultrascan_ping_update(USI, host, probeI, &USI->now);
|
||||
else {
|
||||
ultrascan_port_probe_update(USI, host, probeI, newstate, &USI->now);
|
||||
host->target->ports.setStateReason(probe->dport(), probe->protocol(), current_reason, 0, 0);
|
||||
ultrascan_port_probe_update(USI, host, probeI, newstate, &USI->now);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3158,13 +3158,13 @@ static bool get_pcap_result(UltraScanInfo *USI, struct timeval *stime) {
|
|||
if (probe->isPing())
|
||||
ultrascan_ping_update(USI, hss, probeI, &rcvdtime);
|
||||
else {
|
||||
ultrascan_port_probe_update(USI, hss, probeI, newstate, &rcvdtime);
|
||||
if(USI->prot_scan)
|
||||
hss->target->ports.setStateReason(probe->protocol(), IPPROTO_IP,
|
||||
current_reason, ip->ip_ttl, reason_sip);
|
||||
else
|
||||
hss->target->ports.setStateReason(probe->dport(), probe->protocol(),
|
||||
current_reason, ip->ip_ttl, reason_sip);
|
||||
ultrascan_port_probe_update(USI, hss, probeI, newstate, &rcvdtime);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue