adds check for empty data b4 sending to parser [RM7269]

[fixes RM7269]
we discussed the solution to this bug a lot on IRC and in the ticket
itself, the consensus was to fix it as far upstream as possible before
sending to the parsers so as to avoid any future bugs of the same
nature, so this commit adds a check to import_nmap_xml to see if the
data is empty before passing it on to the parser, whether that parser
is nokogiri or the legacy parser.
db_nmap -h now produces the expected output and db_nmap still works as
expected.
bug/bundler_fix
kernelsmith 2013-01-17 00:18:13 -06:00
parent 4fd4af1f43
commit 7090a4a82f
1 changed files with 1 additions and 0 deletions

View File

@ -4869,6 +4869,7 @@ class DBManager
# If you have Nokogiri installed, you'll be shunted over to
# that. Otherwise, you'll hit the old NmapXMLStreamParser.
def import_nmap_xml(args={}, &block)
return nil if args[:data].empty?
wspace = args[:wspace] || workspace
bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : []