1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 08:51:36 +00:00

Don't write to XML output directly in nmap.cc. Spotted and fixed by

Michal Hrusecki (http://seclists.org/nmap-dev/2014/q3/180).
This commit is contained in:
d33tah
2014-07-31 14:28:20 +00:00
parent 21ab5d78bd
commit fd3b2c79d3
2 changed files with 2 additions and 1 deletions

View File

@@ -1748,7 +1748,6 @@ int nmap_main(int argc, char *argv[]) {
chomp(mytime);
char *xslfname = o.XSLStyleSheet();
xml_start_document();
log_write(LOG_XML, "<!DOCTYPE nmaprun PUBLIC \"-//IDN nmap.org//DTD Nmap XML %s//EN\" \"https://svn.nmap.org/nmap/docs/nmap.dtd\">\n", NMAP_XMLOUTPUTVERSION);
if (xslfname) {
xml_open_pi("xml-stylesheet");
xml_attribute("href", "%s", xslfname);

2
xml.cc
View File

@@ -320,6 +320,8 @@ int xml_start_document() {
if (xml_newline() < 0)
return -1;
log_write(LOG_XML, "<!DOCTYPE nmaprun PUBLIC \"-//IDN nmap.org//DTD Nmap XML %s//EN\" \"https://svn.nmap.org/nmap/docs/nmap.dtd\">\n", NMAP_XMLOUTPUTVERSION);
return 0;
}