Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 6b93334

Browse files
committed
Fix nmap parse bug where nmap results without hosts would not resolve properly
1 parent 1d15d32 commit 6b93334

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

integrations/nmap/parser/parser.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,8 @@ function parseResultFile(fileContent) {
6363
reject(new Error('Error converting XML to JSON in xml2js: ' + err));
6464
} else {
6565
let tempHostList = [];
66-
6766
if (!xmlInput.nmaprun.host) {
68-
//onFailure("There was a problem with the supplied NMAP XML");
69-
return tempHostList;
67+
reject(new Error("Nmap result file didn't contain a valid host. This probably means that the target was specified incorrectly."));
7068
}
7169

7270
xmlInput = xmlInput.nmaprun.host;

0 commit comments

Comments
 (0)