Skip to content

Commit

Permalink
Fix another clusterfuzz identified issue (go-gitea#15096)
Browse files Browse the repository at this point in the history
Backport go-gitea#15096

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed Mar 22, 2021
1 parent 2f09e57 commit 10e4532
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/markup/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (ctx *postProcessCtx) postProcess(rawHTML []byte) ([]byte, error) {
_, _ = res.WriteString("<html><body>")

// Strip out nuls - they're always invalid
_, _ = nulCleaner.WriteString(res, string(tagCleaner.ReplaceAll(rawHTML, []byte("&lt;$1"))))
_, _ = res.Write(tagCleaner.ReplaceAll([]byte(nulCleaner.Replace(string(rawHTML))), []byte("&lt;$1")))

// close the tags
_, _ = res.WriteString("</body></html>")
Expand Down

0 comments on commit 10e4532

Please sign in to comment.