fix(io): make link-name fuzz truncation UTF-8 safe - #60
Conversation
Keep the fuzz target's 128-byte cap while stepping back to a valid character boundary, and cover the deterministic lossy UTF-8 reproducer. Co-authored-by: Codex <noreply@openai.com>
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Rust | Sep 22, 2026 9:48a.m. | Review ↗ | |
| Secrets | Sep 22, 2026 9:48a.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Essentials Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Essentials Run ID: 📒 Files selected for processing (2)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. 📝 SummarySummary by CodeRabbit
WalkthroughThe fuzzing code now centralizes lossy UTF-8 decoding, 128-byte character-safe truncation, and link-name and HDF5-string validation. The link-name fuzz target passes raw input bytes to the shared helper. ChangesLink-name fuzz input handling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The fuzz target now safely bounds UTF-8 input while preserving existing link-name validation, with no current merge-blocking risk remaining. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
✨ Simplify code
Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
The PR successfully addresses the UTF-8 truncation panic by introducing UTF-8-aware boundary checking. The refactoring properly extracts the logic into a reusable helper with appropriate test coverage.
Critical Issue:
- The
truncate_at_char_boundaryfunction has a potential underflow risk in the while loop that needs to be addressed before merge
Once the loop bounds check is fixed, this will be ready to merge.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 5 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
CodeAnt Nitpicks1 code suggestion1. Arbitrarily large fuzz inputs are fully converted and allocated before truncation, so the helper can consume substantial memory despite its 128-byte bound.Performance · |
Address Amazon Q review on link-name fuzz helper: require end > 0 before decrementing while seeking a char boundary. Cited by: Limen-Neural (Grok Bot)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Applied the Amazon Q guard ( Cited by: Limen-Neural (Grok Bot) |
User description
Motivation
fuzz/fuzz_targets/link_names.rstruncated a lossy UTF-8Stringwith&s[..128], which can land inside a multi-byte character and panic the fuzz harness.Description
fuzz::check_link_name_inputand add a new filefuzz/src/lib.rscontaining the helper.const MAX_NAME_BYTES: usize = 128and atruncate_at_char_boundary(value: &str, max_bytes: usize) -> &strhelper that steps back to the previous char boundary rather than slicing at an arbitrary byte index.check_link_nameandcheck_hdf5_stringso library behavior is unchanged for NULs,/,.,.., and empty names.fuzz/src/lib.rsthat exercises the 45-byte reproducer (\n\r\n+ 42 ×0xe6) to verify the harness no longer panics.Testing
cargo fmt --checkand the repository formatting check passed.cargo test,cargo test --features serde,cargo test --all-features, andcargo test --test prop_invariants, and all invoked tests passed.cargo clippy --all-targets --all-features -- -D warningsand it completed without warnings.cargo test --manifest-path fuzz/Cargo.tomlandcargo +nightly fuzz run link_names -- -max_total_time=30 -seed=1, but both fuzz-related runs could not complete because this environment could not downloadlibfuzzer-sys/ nightly toolchain (network proxy returned HTTP 403); the harness logic and deterministic unit test cover the regression despite the unavailable external tooling.Codex Task
Summary by cubic
Stops the
link_namesfuzz target from panicking when truncating lossy UTF-8 at 128 bytes lands inside a multi-byte character. Fuzz input now passes through a shared helper that truncates at a valid character boundary, with the stepping loop guarded against underflow, and a regression test covers the 45-byte reproducer. Library validation behavior for NULs,/,.,.., and empty names is unchanged.Written for commit 52b39f7. Summary will update on new commits.
CodeAnt-AI Description
Prevent link-name fuzzing from crashing on multibyte UTF-8 input
What Changed
Impact
✅ Fuzzing no longer panics on split UTF-8 characters✅ Stable 128-byte input limit✅ Regression coverage for invalid UTF-8 truncation💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
Relationships