Skip to content

Commit

Permalink
Be aware of bad XML format
Browse files Browse the repository at this point in the history
  • Loading branch information
sinn3r committed Jul 1, 2012
1 parent ac52b0c commit fcf5e02
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/post/windows/gather/enum_unattend.rb
Expand Up @@ -63,7 +63,13 @@ def load_unattend(xml_path)
# and return an array or tables
#
def extract_creds(f)
xml = REXML::Document.new(f)
begin
xml = REXML::Document.new(f)
rescue REXML::ParseException => e
print_error("Invalid XML format")
vprint_line(e.message)
return []
end
base_node = 'unattend/settings/component/UserAccounts'
user_accounts = xml.elements[base_node]

Expand Down

0 comments on commit fcf5e02

Please sign in to comment.