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

fix: Fixing the issue of the object.subset method failing to correctly compare array relationships #5969

Merged

Conversation

DCRUNNN
Copy link
Contributor

@DCRUNNN DCRUNNN commented Jun 5, 2023

fix: Fixing the issue of the object.subset method failing to correctly compare array relationships

relative issue:#5968

  1. modify arraySubset method,fixing the incorrect assignment of superElem and adding array boundary checks
  2. add testcases for the code change

--bug=#5968

PTAL

@DCRUNNN DCRUNNN force-pushed the bugfix/object_subset_arrays branch from 67ce70d to c231f85 Compare June 5, 2023 08:51
…y compare array relationships

relative issue:[https://github.com/open-policy-agent/opa/issues/5968]#5968

1. modify arraySubset method,fixing the incorrect assignment of `superElem` and adding array boundary checks
2. add testcases for the code change

--bug=[https://github.com/open-policy-agent/opa/issues/5968]#5968

Signed-off-by: DCRUNNN <458891338@qq.com>
1. fixing the incorrect assignment of `superElem` and adding array boundary checks
2. add testcases for the code change

--bug=[https://github.com/open-policy-agent/opa/issues/5968]#5968

Signed-off-by: DCRUNNN <458891338@qq.com>
…y compare array relationships

>
> relative issue:[https://github.com/open-policy-agent/opa/issues/5968]#5968
>
> 1. modify arraySubset method,fixing the incorrect assignment of `superElem` and adding array boundary checks
> 2. add testcases for the code change
>
> --bug=[https://github.com/open-policy-agent/opa/issues/5968]#5968
>
> Signed-off-by: DCRUNNN <458891338@qq.com>

Signed-off-by: DCRUNNN <458891338@qq.com>
Copy link
Contributor

@johanfylling johanfylling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Great fix @DCRUNNN 😃

return false
}

subElem := sub.Elem(subCursor)
superElem := sub.Elem(superCursor + subCursor)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? Wow, this must have produced a fair share of false positives 😬.

@johanfylling johanfylling merged commit b97ee9d into open-policy-agent:main Jun 5, 2023
ashutosh-narkar pushed a commit to ashutosh-narkar/opa that referenced this pull request Jun 5, 2023
…y compare array relationships (open-policy-agent#5969)

Fixes:open-policy-agent#5968

Signed-off-by: DCRUNNN <458891338@qq.com>
(cherry picked from commit b97ee9d)
ashutosh-narkar pushed a commit that referenced this pull request Jun 6, 2023
…y compare array relationships (#5969)

Fixes:#5968

Signed-off-by: DCRUNNN <458891338@qq.com>
(cherry picked from commit b97ee9d)
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.

2 participants