mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 20:21:56 +00:00
validate per_page before page
plus an additional check just in case Closes #1688
This commit is contained in:
@@ -125,6 +125,10 @@ func SetEventBus(b *types.EventBus) {
|
||||
}
|
||||
|
||||
func validatePage(page, perPage, totalCount int) int {
|
||||
if perPage < 1 {
|
||||
return 1
|
||||
}
|
||||
|
||||
pages := ((totalCount - 1) / perPage) + 1
|
||||
if page < 1 {
|
||||
page = 1
|
||||
|
Reference in New Issue
Block a user