Files
gitea-MIRROR/models/db
T Mohan Aditya 752b24976c fix: avoid page offset overflow in PaginateSlice and ListOptions (#40572)
A huge `page` value made `(page-1)*pageSize` wrap to a negative int.
`PaginateSlice` then panicked with a slice-bounds error (e.g. the cron
and tags APIs), and `ListOptions.GetSkipTake` caused an index panic in
the pull request commits and files APIs. `PaginateSlice` now compares
the page against `len(list)/pageSize`, and `ListOptions` caps the page
so the offset stays in range.

---------

Co-authored-by: silverwind <me@silverwind.io>
2026-11-30 08:38:54 +00:00
..
2026-09-23 23:14:31 +00:00