Skip to content

Commit ee3b406

Browse files
committed
Merge branch 'fuzz2' of https://github.com/AdamKorcz/gitea into fuzz2
2 parents 39cab0b + 9a5ea60 commit ee3b406

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tools/fuzz.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,24 @@ import (
1111
"code.gitea.io/gitea/modules/markup/markdown"
1212
)
1313

14+
// Contains fuzzing functions executed by
15+
// fuzzing engine https://github.com/dvyukov/go-fuzz
16+
//
17+
// The function must return 1 if the fuzzer should increase priority of the given input during subsequent fuzzing
18+
// (for example, the input is lexically correct and was parsed successfully).
19+
// -1 if the input must not be added to corpus even if gives new coverage and 0 otherwise.
20+
1421
func FuzzMarkdownRenderRaw(data []byte) int {
1522
_ = markdown.RenderRaw(data, "", false)
1623
return 1
1724
}
1825

1926
func FuzzMarkupPostProcess(data []byte) int {
2027
var localMetas = map[string]string{
21-
"user": "gogits",
22-
"repo": "gogs",
28+
"user": "go-gitea",
29+
"repo": "gitea",
2330
}
24-
_, err := markup.PostProcess(data, "/tmp", localMetas, false)
31+
_, err := markup.PostProcess(data, "https://example.com", localMetas, false)
2532
if err != nil {
2633
return 0
2734
}

0 commit comments

Comments
 (0)