summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-08-13 07:51:13 +0200
committerGitHub <noreply@github.com>2021-08-13 08:51:13 +0300
commitd2d99a25b763937531d81474657e002f61d9d311 (patch)
tree2d78b2cc586c75ff5940ff74801b90b789ebc846 /tools
parente483ec8b0d7fc165eb7b57b3f1bcec8f46e04c13 (diff)
downloadgitea-d2d99a25b763937531d81474657e002f61d9d311.tar.gz
gitea-d2d99a25b763937531d81474657e002f61d9d311.zip
Fix NPE in fuzzer (#16680) (#16682)
The fuzzer found an issue with the issue pattern processor where there is a spurious path.Clean which does not need to be there. This PR also sets the default AppURL for the fuzzer too. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/fuzz.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/fuzz.go b/tools/fuzz.go
index b48ae0add9..ca35ff4f00 100644
--- a/tools/fuzz.go
+++ b/tools/fuzz.go
@@ -12,6 +12,7 @@ import (
"code.gitea.io/gitea/modules/markup"
"code.gitea.io/gitea/modules/markup/markdown"
+ "code.gitea.io/gitea/modules/setting"
)
// Contains fuzzing functions executed by
@@ -32,6 +33,7 @@ var (
)
func FuzzMarkdownRenderRaw(data []byte) int {
+ setting.AppURL = "http://localhost:3000/"
err := markdown.RenderRaw(&renderContext, bytes.NewReader(data), io.Discard)
if err != nil {
return 0
@@ -40,6 +42,7 @@ func FuzzMarkdownRenderRaw(data []byte) int {
}
func FuzzMarkupPostProcess(data []byte) int {
+ setting.AppURL = "http://localhost:3000/"
err := markup.PostProcess(&renderContext, bytes.NewReader(data), io.Discard)
if err != nil {
return 0