From 23db3375dfa6a882fa7561b840369fa7d145383f Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 22 Mar 2021 19:16:08 +0000 Subject: [PATCH] Fix another clusterfuzz identified issue (#15096) (#15113) Backport #15096 Signed-off-by: Andrew Thornton Co-authored-by: 6543 <6543@obermui.de> --- modules/markup/html.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/markup/html.go b/modules/markup/html.go index a7d66cc24..2ea0b56f7 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -327,7 +327,7 @@ func (ctx *postProcessCtx) postProcess(rawHTML []byte) ([]byte, error) { _, _ = res.WriteString("") // Strip out nuls - they're always invalid - _, _ = nulCleaner.WriteString(res, string(tagCleaner.ReplaceAll(rawHTML, []byte("<$1")))) + _, _ = res.Write(tagCleaner.ReplaceAll([]byte(nulCleaner.Replace(string(rawHTML))), []byte("<$1"))) // close the tags _, _ = res.WriteString("")