From owner-freebsd-testing@freebsd.org Tue Apr 13 11:53:06 2021 Return-Path: Delivered-To: freebsd-testing@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DA045DCCD7 for ; Tue, 13 Apr 2021 11:53:06 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FKPBB0KyKz4cDR for ; Tue, 13 Apr 2021 11:53:05 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [IPv6:2a02:8109:1140:c3d:98eb:c4ec:2233:f5dc] (unknown [IPv6:2a02:8109:1140:c3d:98eb:c4ec:2233:f5dc]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id DE6A6737DFA49 for ; Tue, 13 Apr 2021 13:53:02 +0200 (CEST) From: tuexen@freebsd.org Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Bug in kyua report-html Message-Id: Date: Tue, 13 Apr 2021 13:53:02 +0200 To: freebsd-testing@freebsd.org X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4FKPBB0KyKz4cDR X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE] X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2021 11:53:06 -0000 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 actual packet: 0.100378 S 0:0(0) win 65535 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=