From 5a34d64f8e57fb1881bba4337730bc77b6153c98 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 20 Oct 2008 16:52:42 +0000 Subject: [PATCH] Fix a test condition in the ICMP response checking code for ping scans. A test that should have fired whenever !USI->ptech.rawprotoscan wrongly had the additional condition && o.debugging, meaning that it worked properly only when debugging was enabled. See http://seclists.org/nmap-dev/2008/q4/0130.html and http://seclists.org/nmap-dev/2008/q4/0206.html for problem reports. --- CHANGELOG | 6 ++++++ scan_engine.cc | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 36247c40d..aa70c957b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,11 @@ # Nmap Changelog ($Id$); -*-text-*- +o A crash caused by an incorrect test condition was fixed. It would + happen when running a ping scan other than a protocol ping, without + debugging enabled, if an ICMP packet was received referring to a + packet that was not TCP, UDP, or ICMP. Thanks to Brandon Enright and + Matt Castelein for reporting the problem. [David] + o [Zenmap] The keyboard shortcut for "Save to Directory" has been changed from Ctrl+v to Ctrl+Alt+s so as not to conflict with the usual paste shortcut [Jah, Michael]. diff --git a/scan_engine.cc b/scan_engine.cc index a892227a7..fcd4186e0 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -4315,7 +4315,8 @@ static int get_ping_pcap_result(UltraScanInfo *USI, struct timeval *stime) { /* Did we fail to find a probe? */ if (probenum >= listsz) continue; - } else if (o.debugging && !USI->ptech.rawprotoscan) { + } else if (!USI->ptech.rawprotoscan) { + if (o.debugging) error("Got ICMP response to a packet which was not TCP, UDP, or ICMP"); continue; }