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
|
// ListUnadoptedRepositories lists all the unadopted repositories that match the provided query
|
||||||
func ListUnadoptedRepositories(ctx context.Context, query string, opts *db.ListOptions) ([]string, int64, error) {
|
func ListUnadoptedRepositories(ctx context.Context, query string, opts *db.ListOptions) ([]string, int64, error) {
|
||||||
|
opts.SetDefaultValues()
|
||||||
globUser, _ := glob.Compile("*")
|
globUser, _ := glob.Compile("*")
|
||||||
globRepo, _ := glob.Compile("*")
|
globRepo, _ := glob.Compile("*")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user