Skip to content

Limit the hexencode and bubblebabble results by RB_LEN_MAX - #157

Merged
hsbt merged 1 commit into
masterfrom
claude/great-merkle-20d30e
Oct 12, 2026
Merged

hsbt merged 1 commit into
masterfrom
claude/great-merkle-20d30e

Conversation

@hsbt

@hsbt hsbt commented Oct 12, 2026

Copy link
Copy Markdown
Member

Digest.hexencode and Digest.bubblebabble raise "digest string too long" when the result would exceed LONG_MAX. On mswin long is 32 bits, so once rb_len_t becomes 64 bits there, Digest.hexencode still rejects any input of 1GiB or more although the resulting String could hold it.

This limits the results by RB_LEN_MAX instead, falling back to LONG_MAX on Ruby versions without HAVE_RB_LEN_T. Nothing changes where rb_len_t is long.

Generated with Claude Code

The result is a String, whose length can exceed LONG_MAX on mswin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hsbt
hsbt requested a review from knu as a code owner October 12, 2026 02:02
@hsbt
hsbt merged commit 39588c8 into master Oct 12, 2026
88 checks passed
@hsbt
hsbt deleted the claude/great-merkle-20d30e branch October 12, 2026 09:08
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.

1 participant