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

Ref-head partial object doc rules can cause nil pointer dereference in compiler #6930

Closed
johanfylling opened this issue Aug 14, 2024 · 0 comments · Fixed by #6931
Closed
Labels

Comments

@johanfylling
Copy link
Contributor

The following module will cause a nil pointer dereference at

node.values.Add(rule.Head.Value)
in the BuildRuleIndices compiler stage:

package test
import future.keywords

p.q contains "foo"

p[q] := r if {
	q := "bar"
	r := "baz"
}

Omitting the if keyword causes the issue to not be triggered.

johanfylling added a commit to johanfylling/opa that referenced this issue Aug 14, 2024
… case

Only appending rule to trieNode values list if it has declared value.

Fixes: open-policy-agent#6930
Signed-off-by: Johan Fylling <[email protected]>
johanfylling added a commit to johanfylling/opa that referenced this issue Aug 14, 2024
… case

Only appending rule to trieNode values list if it has declared value.

Fixes: open-policy-agent#6930
Signed-off-by: Johan Fylling <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant