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 a crash in mismatched output check for nested rules #1086

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

seirl
Copy link
Collaborator

@seirl seirl commented Dec 5, 2024

Minimal repro:

rule:
  match:
    - condition: "1 < 0"
      output: "true"
    - condition: "1 > 0"
      rule:
        match:
          - output: "'false'"

This would segfault the Policy Compiler, because it would try to access .Output().SourceID() of the second block to log an error, but .Output() is nil for nested rules.

@seirl seirl force-pushed the fix_output_match_crash branch 2 times, most recently from bf2f3c1 to 5bcce86 Compare December 5, 2024 15:22
Minimal repro:

    rule:
      match:
        - condition: "1 < 0"
          output: "true"
        - condition: "1 > 0"
          rule:
            match:
              - output: "'false'"

This would segfault the Policy Compiler, because it would try to access
`.Output().SourceID()` of the second block to log an error, but
`.Output()` is nil for nested rules.
@seirl seirl force-pushed the fix_output_match_crash branch from 5bcce86 to e0e5c50 Compare December 5, 2024 15:23
@TristonianJones TristonianJones merged commit c096438 into google:master Dec 5, 2024
2 checks passed
@seirl seirl deleted the fix_output_match_crash branch December 5, 2024 15:39
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