Clamp all Container stack amounts to 0..2^31-1 #47
Labels
No labels
bug
ci-cd
client
epic:security-hardening
feature
optimization
priority:high
priority:low
priority:medium
server
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
BlackLobster/Server#47
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Trade caps coin overflow, but it is unconfirmed that every
Game.Item.Containeradd/remove (bank, ground items, general stackables) clamps amounts to the RS valid range0..2_147_483_647. An overflow past 2^31-1 or a negative amount (crafted withdraw-X, add-to-near-max stack) can dupe or vaporize items.Task
Audit
Container.add/removeand all stack-amount arithmetic; clamp/validate to0..2^31-1, reject or split on overflow. Property test: random add/remove sequences never produce negative or>maxamounts.Acceptance
0..2_147_483_647.Refs:
lib/black_lobster/game/item/container.exand callers.Part of the Security & Data-Integrity Hardening epic.