Skip to content

fix: checked_mul in reserve_capacity to prevent integer overflow - #17

Open
ksj1230 wants to merge 1 commit into
LiquidityC:masterfrom
ksj1230:fix/reserve-capacity-overflow
Open

ksj1230 wants to merge 1 commit into
LiquidityC:masterfrom
ksj1230:fix/reserve-capacity-overflow

Conversation

@ksj1230

@ksj1230 ksj1230 commented Sep 15, 2026

Copy link
Copy Markdown

Fixes #16

reserve_capacity computes 2 * new_capacity without overflow check. Replace with checked_mul(2) to panic on overflow instead of silently wrapping to zero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integer Overflow in reserve_capacity Leads to Heap Corruption / SEGV

1 participant