Skip to content

fix issue #258: guard error_chain_arena.reserve() against SIZE_MAX pqlimit#262

Merged
noajshu merged 1 commit into
mainfrom
fix/vector-reserve-size-max
Jun 15, 2026
Merged

fix issue #258: guard error_chain_arena.reserve() against SIZE_MAX pqlimit#262
noajshu merged 1 commit into
mainfrom
fix/vector-reserve-size-max

Conversation

@LalehB

@LalehB LalehB commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Fixing issue #258
When --pqlimit is not specified, it defaults to std::numeric_limits<size_t>::max()
(SIZE_MAX). Calling vector::reserve(SIZE_MAX) exceeds the vector's max_size()
and throws std::length_error, crashing the process.
Fix by only calling reserve() when pqlimit is a finite (non-SIZE_MAX) value.

@LalehB LalehB requested a review from a team as a code owner June 15, 2026 05:16
@LalehB LalehB requested review from noajshu and removed request for a team June 15, 2026 05:16

@noajshu noajshu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this is indeed an important edge case!

@noajshu noajshu merged commit e83a468 into main Jun 15, 2026
14 checks passed
@noajshu noajshu deleted the fix/vector-reserve-size-max branch June 15, 2026 05:52
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.

2 participants