Repository navigation
fix(query): prevent Unicode panic in dictionary error messages - #1801
Merged
Merged
Conversation
zonotope
approved these changes
Sep 10, 2026
zonotope
left a comment
Contributor
There was a problem hiding this comment.
Claude found the same panic risk from truncating user input in 3 other paths:
- Turtle import truncates the prefix block at byte 500 for tracing at
fluree-graph-turtle/src/splitter.rs:238andfluree-db-api/src/import.rs - Turtle import truncates the prefix block at byte 200 at
fluree-graph-turtle/src/splitter.rs:994 - Chunk text is truncated at byte 200 at
fluree-db-api/src/import.rs:4609
The first two are tracing::info!, so they could panic in production. I'm fine with filing an issue for those if you don't want to take it in this pr.
Other than that, lgtm
Contributor
Author
|
Addressed in c330798 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a missing dictionary string has a multibyte UTF-8 character spanning byte 50,
resolve_string_v3panics while formatting itsNotFounderror. For example, 49 ASCII characters followed by±trigger the panic; withpanic=abort, this terminates the server.Truncate the error preview to 50 Unicode characters and extract the error construction into a helper for regression coverage. Dictionary lookup behavior is unchanged.
Validation:
cargo test -p fluree-db-query --lib --locked: 1,553 passed, 1 ignored.cargo fmt --all --checkandgit diff --checkpassed.RUSTC_WRAPPER= cargo clippy -p fluree-db-query --lib --tests --locked --no-deps -- -D warningspassed (the local sccache wrapper failed to start).