From: zeripath Date: Mon, 22 Mar 2021 01:45:01 +0000 (+0000) Subject: Fix another clusterfuzz identified issue (#15096) X-Git-Tag: v1.15.0-rc1~579 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a587a284349e7c27d1bec39ef0dedb3972ef68c5;p=gitea.git Fix another clusterfuzz identified issue (#15096) * Fix another clusterfuzz identified issue Signed-off-by: Andrew Thornton --- diff --git a/modules/markup/html.go b/modules/markup/html.go index a7d66cc249..2ea0b56f72 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("")