1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-05 06:09:00 +00:00

Correct to DTD, explicitly show empty output. See #2216

This shouldn't happen, so we'll print a "bug" error message so users
notify us.
This commit is contained in:
dmiller
2021-01-01 19:25:56 +00:00
parent 9a3a8d1593
commit 3ecec3f4dc

View File

@@ -521,6 +521,10 @@ void ScriptResult::write_xml() const
output_str = get_output_str();
if (!output_str.empty())
xml_attribute("output", "%s", protect_xml(output_str).c_str());
else {
error("Bug in %s: no string output.", get_id());
xml_attribute("output", "%s", "");
}
/* Any table output? */
lua_rawgeti(L_NSE, LUA_REGISTRYINDEX, output_ref);