mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Close an open start tag before a fatal error.
This is part of the error handler that attempts to close open XML tags at a fatal error. The case wasn't handled where a fatal error happened while a start tag was still open (didn't have its '>' written yet). This came from a bug report from David Hingos. http://seclists.org/nmap-dev/2012/q1/514
This commit is contained in:
parent
e1576d1d14
commit
fa0713e041
3 changed files with 10 additions and 0 deletions
|
|
@ -122,6 +122,8 @@ void fatal(const char *fmt, ...) {
|
|||
}
|
||||
log_write(o.log_errors? LOG_NORMAL|LOG_STDERR : LOG_STDERR, "\nQUITTING!\n");
|
||||
|
||||
if (xml_tag_open())
|
||||
xml_close_start_tag();
|
||||
if (!xml_root_written())
|
||||
xml_start_tag("nmaprun");
|
||||
/* Close all open XML elements but one. */
|
||||
|
|
@ -198,6 +200,8 @@ void pfatal(const char *fmt, ...) {
|
|||
log_write(o.log_errors? LOG_NORMAL|LOG_STDERR : LOG_STDERR, "%s: %s (%d)\n",
|
||||
errbuf, strerror_s, error_number);
|
||||
|
||||
if (xml_tag_open())
|
||||
xml_close_start_tag();
|
||||
if (!xml_root_written())
|
||||
xml_start_tag("nmaprun");
|
||||
/* Close all open XML elements but one. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue