mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 06:01:28 +00:00
Handle the special case of an empty services list.
There should be better error handling here in general, but an empty string is something that Nmap can legitimately emit. http://seclists.org/nmap-dev/2012/q2/876
This commit is contained in:
@@ -668,8 +668,11 @@ in epoch format!")
|
|||||||
#Create a dict of port -> protocol for all ports scanned
|
#Create a dict of port -> protocol for all ports scanned
|
||||||
ports = {}
|
ports = {}
|
||||||
for scaninfo in self.scaninfo:
|
for scaninfo in self.scaninfo:
|
||||||
services_string = scaninfo['services']
|
services_string = scaninfo['services'].strip()
|
||||||
services_array = services_string.split(',')
|
if services_string == "":
|
||||||
|
services_array = []
|
||||||
|
else:
|
||||||
|
services_array = services_string.split(',')
|
||||||
for item in services_array:
|
for item in services_array:
|
||||||
if item.find('-') == -1:
|
if item.find('-') == -1:
|
||||||
if int(item) not in ports:
|
if int(item) not in ports:
|
||||||
|
|||||||
Reference in New Issue
Block a user