From 3ecec3f4dc3be3d8281264b3efb703d1ce167fdb Mon Sep 17 00:00:00 2001 From: dmiller Date: Fri, 1 Jan 2021 19:25:56 +0000 Subject: [PATCH] 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. --- nse_main.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nse_main.cc b/nse_main.cc index 7b028d420..b30ab48fd 100644 --- a/nse_main.cc +++ b/nse_main.cc @@ -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);