-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Added 2 fuzzers #13818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Added 2 fuzzers #13818
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2d7f934
Added fuzzer
AdamKorcz d6e3cab
Added better fuzzer names
AdamKorcz 1a95d77
Moved fuzzer to /tools
AdamKorcz 8c8744f
Update tools/fuzz.go
AdamKorcz 197cd8e
Merge branch 'master' into fuzz2
6543 e384556
Merge branch 'master' into fuzz2
6543 280ffad
Update tools/fuzz.go
6543 b7de19f
Merge branch 'master' into fuzz2
6543 cf9941e
Update tools/fuzz.go
6543 6bd9f05
Merge branch 'master' into fuzz2
6543 caf776e
Merge branch 'master' into fuzz2
6543 f290e04
Merge branch 'master' of https://github.com/go-gitea/gitea into fuzz2
AdamKorcz 9a5ea60
Merge branch 'master' into fuzz2
zeripath 39cab0b
Added tools to Makefile
AdamKorcz ee3b406
Merge branch 'fuzz2' of https://github.com/AdamKorcz/gitea into fuzz2
AdamKorcz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2020 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
// +build gofuzz | ||
|
||
package fuzz | ||
|
||
import ( | ||
"code.gitea.io/gitea/modules/markup" | ||
"code.gitea.io/gitea/modules/markup/markdown" | ||
) | ||
|
||
// Contains fuzzing functions executed by | ||
// fuzzing engine https://github.com/dvyukov/go-fuzz | ||
// | ||
// The function must return 1 if the fuzzer should increase priority of the given input during subsequent fuzzing | ||
// (for example, the input is lexically correct and was parsed successfully). | ||
// -1 if the input must not be added to corpus even if gives new coverage and 0 otherwise. | ||
|
||
func FuzzMarkdownRenderRaw(data []byte) int { | ||
_ = markdown.RenderRaw(data, "", false) | ||
return 1 | ||
} | ||
|
||
func FuzzMarkupPostProcess(data []byte) int { | ||
var localMetas = map[string]string{ | ||
"user": "gogits", | ||
"repo": "gogs", | ||
6543 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
6543 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
_, err := markup.PostProcess(data, "/tmp", localMetas, false) | ||
6543 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if err != nil { | ||
return 0 | ||
} | ||
return 1 | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.