Skip to content

Fix crashes in CompiledExpression::Compile when compiling malformed FHIRPath expressions: - #576

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_1005385007
Oct 29, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_1005385007

Conversation

@copybara-service

Copy link
Copy Markdown

Fix crashes in CompiledExpression::Compile when compiling malformed FHIRPath expressions:

  1. Catch std::exception when invoking ANTLR so invalid UTF-8 input strings return absl::InvalidArgumentError instead of throwing an uncaught antlr4::IllegalArgumentException.
  2. Add child vector bounds checks and null checks in FhirPathCompilerVisitor methods so incomplete ANTLR parse trees (such as "%" or "-%") return an error instead of aborting.

@google-cla

google-cla Bot commented Oct 27, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

… FHIRPath expressions:

1. Catch `std::exception` when invoking ANTLR so invalid UTF-8 input strings return `absl::InvalidArgumentError` instead of throwing an uncaught `antlr4::IllegalArgumentException`.
2. Add child vector bounds checks and null checks in `FhirPathCompilerVisitor` methods so incomplete ANTLR parse trees (such as `"%"` or `"-%"`) return an error instead of aborting.

PiperOrigin-RevId: 1007865079
@copybara-service
copybara-service Bot merged commit 1f8f3e8 into master Oct 29, 2026
2 of 3 checks passed
@copybara-service
copybara-service Bot deleted the test_1005385007 branch October 29, 2026 09:06
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.

0 participants