-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[BUG]: slice bounds out of range at modules/git #20315
Comments
So I assume you are using SHA256 but not SHA1 ? |
Since that's generated by a fuzz test, it doesn't need to be SHA256 or SHA1. |
Fuzzing Gitea directly by calling it's function is risky and IMO incorrect, because you want to make sure that fuzz-data go trough all stages as a normal workflow would, so just fuzzing a specific function in I had a quick look at the function and there are two references, one is for testing and the other reference is a helper function for parsing the raw stdout of git commands. Unless git decides to change this output or somehow be able to corrupt the output this panic cannot ever exist. |
-> Refactor parseTreeEntries, speed up tree list #21368 The minimal reproducible case is: package main
import "code.gitea.io/gitea/modules/git"
func main() {
// "runtime error: slice bounds out of range"
ParseTreeEntries([]byte("100644 blob ea0d83c9081af9500ac9f804101b3fd0a5c293af"))
} |
Description
I tried to parse some data with ParseTreeEntries in modules/git, but it crashed instead of returning an error
Found by go-fuzz
Gitea Version
with git commit as ee769f7
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
Ubuntu
How are you running Gitea?
I test the API in Gitea through go-fuzz
Database
No response
The text was updated successfully, but these errors were encountered: