Date: Tue, 13 Apr 2021 13:53:02 +0200 From: tuexen@freebsd.org To: freebsd-testing@freebsd.org Subject: Bug in kyua report-html Message-ID: <F8741255-C73F-4DCF-96C8-B345863E54ED@freebsd.org>
next in thread | raw e-mail | index | archive | help
Dear all,
there is a bug in the generation of the html: Output like
stderr:
=
/home/tuexen/tcp-testsuite/fast-open/client/client-handle-cookie-reject-of=
-length-32.pkt:49: error handling packet: live packet field =
ipv4_total_length: expected: 64 (0x40) vs actual: 60 (0x3c)
script packet: 0.174887 S 0:0(0) win 65535 <mss 1460,nop,wscale =
6,sackOK,TS val 0 ecr 0,FO,eol,eol>
actual packet: 0.100378 S 0:0(0) win 65535 <mss 1460,nop,wscale =
6,sackOK,TS val 0 ecr 0>
is not escaped such that parts starting with < are not rendered =
correclty.
A proposed fix would be:
diff --git a/contrib/kyua/cli/cmd_report_html.cpp =
b/contrib/kyua/cli/cmd_report_html.cpp
index b2133a8de04..9c99e434825 100644
--- a/contrib/kyua/cli/cmd_report_html.cpp
+++ b/contrib/kyua/cli/cmd_report_html.cpp
@@ -54,6 +54,7 @@
#include "utils/fs/operations.hpp"
#include "utils/fs/path.hpp"
#include "utils/optional.ipp"
+#include "utils/text/operations.hpp"
#include "utils/text/templates.hpp"
=20
namespace cmdline =3D utils::cmdline;
@@ -365,12 +366,12 @@ class html_hooks : public =
drivers::scan_results::base_hooks {
{
const std::string stdout_text =3D iter.stdout_contents();
if (!stdout_text.empty())
- templates.add_variable("stdout", stdout_text);
+ templates.add_variable("stdout", =
text::escape_xml(stdout_text));
}
{
const std::string stderr_text =3D iter.stderr_contents();
if (!stderr_text.empty())
- templates.add_variable("stderr", stderr_text);
+ templates.add_variable("stderr", =
text::escape_xml(stderr_text));
}
=20
generate(templates, "test_result.html",
Should I open a review on phabricator to get this into the FreeBSD =
source tree or should I submit
the fix to some other upstream repo, since the kyua code is in the =
contrib folder.
Best regards
Michael=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F8741255-C73F-4DCF-96C8-B345863E54ED>
