fix(parse_nessus): bug fix

Fix null parameter call
This commit is contained in:
Ryan Prather 2019-01-16 10:49:54 -05:00
parent 059d84f953
commit 9620adf3b9
No known key found for this signature in database
GPG Key ID: 66FDE2B4E8AB87A7

View File

@ -1205,13 +1205,11 @@ class nessus_parser extends scan_xml_parser
if ($this->plugin->sev == 0) { if ($this->plugin->sev == 0) {
return; return;
} }
if (false) { /** @var nessus_result $this->plugin->result */
$this->plugin->result = new nessus_result();
}
$finding = $this->db->get_Finding($this->tgt, $this->plugin->db_plugin); $finding = $this->db->get_Finding($this->tgt, $this->plugin->db_plugin);
if (is_array($finding) && count($finding) && isset($finding[0])) { if (is_array($finding) && count($finding)) {
$finding = current($finding[0]); $finding = current($finding);
} }
if (is_a($finding, 'finding')) { if (is_a($finding, 'finding')) {
@ -1228,10 +1226,8 @@ class nessus_parser extends scan_xml_parser
} }
if (is_array($orig_scan) && count($orig_scan)) { if (is_array($orig_scan) && count($orig_scan)) {
/** @var scan $orig_scan */
$orig_scan = $orig_scan[0]; $orig_scan = $orig_scan[0];
if (false) {
$orig_scan = new scan();
}
$finding->set_Original_Source($orig_scan->get_Source()->get_Name()); $finding->set_Original_Source($orig_scan->get_Source()->get_Name());
$finding->set_Scan_ID($this->scan->get_ID()); $finding->set_Scan_ID($this->scan->get_ID());