Skip to content

Size the CGI.escapeHTML overflow test by rb_len_t - #147

Merged
hsbt merged 1 commit into
masterfrom
claude/mswin-escape-large-21bd50
Nov 26, 2026
Merged

hsbt merged 1 commit into
masterfrom
claude/mswin-escape-large-21bd50

Conversation

@hsbt

@hsbt hsbt commented Nov 26, 2026

Copy link
Copy Markdown
Member

test_cgi_escape_html_large fails on ruby-head mswin with "ArgumentError expected but nothing was raised", which blocks #145 and #146.

ruby/ruby@4e746b14fd2 made rb_len_t 64 bits on mswin, so the input of ULONG_MAX / 6 + 1 bytes no longer overflows and escapeHTML returns the correct result. This ports ruby/ruby@3edde2d2a20, which sizes the test by rb_len_t instead of long. It still runs on mingw and on older Rubies.

Generated with Claude Code

The test assumed the length is narrower than size_t wherever unsigned long is, which stops holding once rb_len_t widens on mswin. It keeps running on mingw.

https://bugs.ruby-lang.org/issues/22400

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hsbt
hsbt merged commit cdb6d53 into master Nov 26, 2026
70 checks passed
@hsbt
hsbt deleted the claude/mswin-escape-large-21bd50 branch November 26, 2026 10:03
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