Repository navigation
Conversation
jay
reviewed
Oct 1, 2026
jay
reviewed
Oct 1, 2026
jay
approved these changes
Oct 3, 2026
bagder
approved these changes
Oct 3, 2026
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The C-string wrapper still dereferences a NULL name, and overflow boundaries lack regression coverage.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds overflow-safe dynamic header handling and removes unsafe integer casts during formatting.
Changes:
- Validates header arguments and size calculations.
- Supports NULL zero-length values.
- Formats headers through bounded dynbuf appends.
| File | Description |
|---|---|
lib/dynhds.c |
Adds validation, overflow checks, and safer formatting. |
tests/unit/unit2602.c |
Tests NULL empty header values. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
When adding headers, check arguments and make sure lengths do not overflow size_t calculations. When formatting headers, use individual dynbuf adds instead of %.*s formats that require int casts. reported-by: Joshua Rogers
Also, provide for adding 0-length value with NULL. Add unit tests for that.
- check name param on cadd - add test for overflow prevention
icing
force-pushed
the
dynhds-overflow-checks
branch
from
October 5, 2026 06:51
4fa7bba to
e23062c
Compare
bagder
approved these changes
Oct 5, 2026
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 adding headers, check arguments and make sure lengths do not overflow size_t calculations.
When formatting headers, use individual dynbuf adds instead of %.*s formats that require int casts.
reported-by: Joshua Rogers