nexpose 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/nexpose/scan.rb +9 -1
  2. metadata +2 -2
@@ -125,7 +125,12 @@ module Nexpose
125
125
  vulns = Vulnerabilities.parse(rexml.attributes['scan-id'], rexml)
126
126
  msg = rexml.elements['message'] ? rexml.elements['message'].text : nil
127
127
 
128
- start_time = DateTime.parse(rexml.attributes['startTime'].to_s).to_time
128
+ # Start time can be empty in some error conditions.
129
+ start_time = nil
130
+ unless rexml.attributes['startTime'] == ''
131
+ start_time = DateTime.parse(rexml.attributes['startTime'].to_s).to_time
132
+ end
133
+
129
134
  # End time is often not present, since reporting on running scans.
130
135
  end_time = nil
131
136
  if rexml.attributes['endTime']
@@ -158,6 +163,7 @@ module Nexpose
158
163
  # @return [Tasks] Task summary represented by the XML.
159
164
  #
160
165
  def self.parse(rexml)
166
+ return nil unless rexml
161
167
  return Tasks.new(rexml.attributes['pending'].to_i,
162
168
  rexml.attributes['active'].to_i,
163
169
  rexml.attributes['completed'].to_i)
@@ -179,6 +185,7 @@ module Nexpose
179
185
  # @return [Nodes] Node summary represented by the XML.
180
186
  #
181
187
  def self.parse(rexml)
188
+ return nil unless rexml
182
189
  return Nodes.new(rexml.attributes['live'].to_i,
183
190
  rexml.attributes['dead'].to_i,
184
191
  rexml.attributes['filtered'].to_i,
@@ -212,6 +219,7 @@ module Nexpose
212
219
  # @return [Vulnerabilities] Vulnerability summary represented by the XML.
213
220
  #
214
221
  def self.parse(scan_id, rexml)
222
+ return nil unless rexml
215
223
  map = {}
216
224
  rexml.elements.each("//ScanSummary[contains(@scan-id,'#{scan_id}')]/vulnerabilities") do |vuln|
217
225
  status = map[vuln.attributes['status']]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexpose
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-02-14 00:00:00.000000000 Z
13
+ date: 2013-02-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: librex