From 6198403fbc4e6d2ba497eecd54b113a7752399b2 Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 22 Mar 2021 20:27:21 +0000 Subject: [PATCH] Fix another clusterfuzz identified issue (#15096) (#15114) Backport #15096 Signed-off-by: Andrew Thornton Co-authored-by: techknowlogick --- 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 c2e574e3b29..b462b6b34b6 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -312,7 +312,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("")