Files
gitea-MIRROR/modules/util
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-11-10 16:29:36 +00:00
2026-10-24 13:48:19 +00:00
2024-06-11 18:47:45 +00:00
2023-07-04 18:36:08 +00:00
2023-05-08 19:49:59 +08:00