Skip to content
New issue

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

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

Already on GitHub? # to your account

Handle multiple values in case/when ... #1734

Merged
merged 1 commit into from
Oct 9, 2022
Merged

Conversation

presidentbeef
Copy link
Owner

Do not warn about these cases:

case x
when 1, 2, 3
  maybe_dangerous(x)
end

and

y = [1, 2, 3]

case x
when *y
  maybe_dangerous(x)
end

(In the future, it might make sense to assign a union of the values (e.g. x = 1 || 2 || 3), but not doing that now because it has performance implications and not sure it matters for security issues.)

Fixes #1730

@presidentbeef presidentbeef merged commit 61b7946 into main Oct 9, 2022
@presidentbeef presidentbeef deleted the case_splat_safe branch October 9, 2022 07:33
Repository owner locked and limited conversation to collaborators May 9, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive dangerous send case when
1 participant