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 num_pow #3677

Closed
clayton-shopify opened this Issue May 30, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@clayton-shopify
Contributor

clayton-shopify commented May 30, 2017

The following input demonstrates an infinite loop:

1**-1

The problem was introduced in 06c4933. Since -1 >> 1 == -1, exp never reaches zero:

mruby/src/numeric.c

Lines 72 to 73 in ef11584

exp >>= 1;
if (exp == 0) break;

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

@matz matz closed this in 877f9d0 May 31, 2017

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