From e88501789cdd113a8e4dfb861ea2ebd20a201be1 Mon Sep 17 00:00:00 2001 From: James Lee Date: Thu, 24 May 2012 10:41:30 -0600 Subject: [PATCH] Make sure state is initialized Fixes a stack trace when the xml has osmatch before osclass. Thanks Sean Carolan for the report! --- lib/rex/parser/nmap_nokogiri.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rex/parser/nmap_nokogiri.rb b/lib/rex/parser/nmap_nokogiri.rb index b380d94af2..1fa41a3fb4 100644 --- a/lib/rex/parser/nmap_nokogiri.rb +++ b/lib/rex/parser/nmap_nokogiri.rb @@ -118,6 +118,7 @@ module Rex return unless in_tag("os") temp_hash = attr_hash(attrs) if temp_hash["accuracy"].to_i == 100 + @state[:os] ||= {} @state[:os]["osmatch"] = temp_hash["name"] end end