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

memory issues with large ranges #243

Closed
carlshimer opened this issue Apr 7, 2015 · 2 comments
Closed

memory issues with large ranges #243

carlshimer opened this issue Apr 7, 2015 · 2 comments

Comments

@carlshimer
Copy link

I had an API definition that looked like:

requires :blahvalue, :type => Integer, values: 1262358112..3000000000, :desc => "foo"

This was designed to use a range to check to do basic validation. However, this blows up in the following code:

enum_values = enum_values.to_a if enum_values && enum_values.is_a?(Range)

to_a expands the range completely into an array. Which is very dangerous :)

@dblock
Copy link
Member

dblock commented Apr 7, 2015

This has been discussed and is definitely a problem, I'd appreciate a PR/fix.

@dblock
Copy link
Member

dblock commented Apr 7, 2015

@dblock dblock closed this as completed Apr 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants