Skip to content

Commit 7090a4a

Browse files
author
kernelsmith
committed
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.
1 parent 4fd4af1 commit 7090a4a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/msf/core/db.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4869,6 +4869,7 @@ def import_nmap_noko_stream(args, &block)
48694869
# If you have Nokogiri installed, you'll be shunted over to
48704870
# that. Otherwise, you'll hit the old NmapXMLStreamParser.
48714871
def import_nmap_xml(args={}, &block)
4872+
return nil if args[:data].empty?
48724873
wspace = args[:wspace] || workspace
48734874
bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : []
48744875

0 commit comments

Comments
 (0)