]> source.dussan.org Git - gitea.git/commitdiff
Fix another clusterfuzz identified issue (#15096)
authorzeripath <art27@cantab.net>
Mon, 22 Mar 2021 01:45:01 +0000 (01:45 +0000)
committerGitHub <noreply@github.com>
Mon, 22 Mar 2021 01:45:01 +0000 (02:45 +0100)
* Fix another clusterfuzz identified issue

Signed-off-by: Andrew Thornton <art27@cantab.net>
modules/markup/html.go

index a7d66cc2490a7c836e1cb85e0e69cd0af0228a2b..2ea0b56f727880a7148243941fc4011a861674e3 100644 (file)
@@ -327,7 +327,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>")