Skip to content

Commit

Permalink
Merge pull request securego#163 from wongherlung/fix-junit-failure-text
Browse files Browse the repository at this point in the history
Escape html string for JUnit output
  • Loading branch information
gcmurphy committed Feb 2, 2018
2 parents e92170b + 33fff95 commit 8b87505
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion output/junit_xml_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package output

import (
"encoding/xml"
htmlLib "html"
"strconv"

"github.com/GoASTScanner/gas"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 8b87505

Please sign in to comment.