Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop in Range#each #3489

Closed
clayton-shopify opened this issue Mar 8, 2017 · 0 comments
Closed

Infinite loop in Range#each #3489

clayton-shopify opened this issue Mar 8, 2017 · 0 comments

Comments

@clayton-shopify
Copy link
Contributor

The following input results in an infinite loop:

('A'..'a').to_a

This occurs because Range#each uses succ to advance to the next value and 'Z'.succ produces "AA" instead of "[".

MRI produces the expected result:

irb(main):001:0> ('A'..'a').to_a
=> ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\\", "]", "^", "_", "`", "a"]

This issue was reported by https://hackerone.com/mg36

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

No branches or pull requests

1 participant