Every limit or offset that reaches a sqlc int32 parameter is clamped the way
internal/infrastructure/postgres/store.go:704 already clamps TaskPage.
Evidence
internal/gateway/session_store_postgres.go:488, internal/infrastructure/postgres/events.go:66,75,142,
internal/infrastructure/postgres/steps.go:69 and internal/infrastructure/postgres/access.go:219 convert a
caller-supplied int straight to int32. A value past math.MaxInt32 wraps negative
and Postgres rejects the query with "LIMIT must not be negative". gosec G115
flags each conversion.
Stop when
[ ] Each conversion clamps at its boundary, or takes a value already bounded there.
[ ] A limit past the bound returns the deep page rather than a query error.
Close reason
Events, TokensByDay and ListDenials clamp at the boundary; gateway search limit is already capped and step depth is bounded by MaxCallDepth
Imported from beads archie-core-g14d · GitHub #1555 · type task · priority P2 · created 2026-10-08 · closed 2026-10-13
## Goal
Every limit or offset that reaches a sqlc int32 parameter is clamped the way
internal/infrastructure/postgres/store.go:704 already clamps TaskPage.
## Evidence
internal/gateway/session_store_postgres.go:488, internal/infrastructure/postgres/events.go:66,75,142,
internal/infrastructure/postgres/steps.go:69 and internal/infrastructure/postgres/access.go:219 convert a
caller-supplied int straight to int32. A value past math.MaxInt32 wraps negative
and Postgres rejects the query with "LIMIT must not be negative". gosec G115
flags each conversion.
## Stop when
[ ] Each conversion clamps at its boundary, or takes a value already bounded there.
[ ] A limit past the bound returns the deep page rather than a query error.
### Close reason
Events, TokensByDay and ListDenials clamp at the boundary; gateway search limit is already capped and step depth is bounded by MaxCallDepth
---
_Imported from beads `archie-core-g14d` · GitHub #1555 · type task · priority P2 · created 2026-10-08 · closed 2026-10-13_
sam
added the mediumtask labels 2026-10-27 13:39:57 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Goal
Every limit or offset that reaches a sqlc int32 parameter is clamped the way
internal/infrastructure/postgres/store.go:704 already clamps TaskPage.
Evidence
internal/gateway/session_store_postgres.go:488, internal/infrastructure/postgres/events.go:66,75,142,
internal/infrastructure/postgres/steps.go:69 and internal/infrastructure/postgres/access.go:219 convert a
caller-supplied int straight to int32. A value past math.MaxInt32 wraps negative
and Postgres rejects the query with "LIMIT must not be negative". gosec G115
flags each conversion.
Stop when
[ ] Each conversion clamps at its boundary, or takes a value already bounded there.
[ ] A limit past the bound returns the deep page rather than a query error.
Close reason
Events, TokensByDay and ListDenials clamp at the boundary; gateway search limit is already capped and step depth is bounded by MaxCallDepth
Imported from beads
archie-core-g14d· GitHub #1555 · type task · priority P2 · created 2026-10-08 · closed 2026-10-13