mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-15 09:00:32 +01:00
Bound PageSize in ListUnadoptedRepositories (#36884)
Add `SetDefaultValues()` call to ensure PageSize is bounded, preventing potential excessive memory allocation from unbounded pagination parameters. Fixes CodeQL alert [#188](https://github.com/go-gitea/gitea/security/code-scanning/188). All other 49 open alerts were false-positives and are dismissed with appropriate comments. Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
This commit is contained in:
@@ -291,6 +291,7 @@ func checkUnadoptedRepositories(ctx context.Context, userName string, repoNamesT
|
||||
|
||||
// ListUnadoptedRepositories lists all the unadopted repositories that match the provided query
|
||||
func ListUnadoptedRepositories(ctx context.Context, query string, opts *db.ListOptions) ([]string, int64, error) {
|
||||
opts.SetDefaultValues()
|
||||
globUser, _ := glob.Compile("*")
|
||||
globRepo, _ := glob.Compile("*")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user