From 33fff9514f211abc35f9723c87723f5b49fa0faa Mon Sep 17 00:00:00 2001 From: Delon Wong Her Laang Date: Thu, 1 Feb 2018 12:30:47 +0800 Subject: [PATCH] Excape html string for junit output. --- output/junit_xml_format.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/output/junit_xml_format.go b/output/junit_xml_format.go index 97960791c..2fd5c39a9 100644 --- a/output/junit_xml_format.go +++ b/output/junit_xml_format.go @@ -2,6 +2,7 @@ package output import ( "encoding/xml" + htmlLib "html" "strconv" "github.com/GoASTScanner/gas" @@ -35,7 +36,7 @@ func generatePlaintext(issue *gas.Issue) string { return "Results:\n" + "[" + issue.File + ":" + issue.Line + "] - " + issue.What + " (Confidence: " + strconv.Itoa(int(issue.Confidence)) + - ", Severity: " + strconv.Itoa(int(issue.Severity)) + ")\n" + "> " + issue.Code + ", Severity: " + strconv.Itoa(int(issue.Severity)) + ")\n" + "> " + htmlLib.EscapeString(issue.Code) } func groupDataByRules(data *reportInfo) map[string][]*gas.Issue {