Repository navigation
cookie: reload complete self-generated cookie jar rows - #23407
Closed
cla7aye15I4nd wants to merge 4 commits into
Closed
cla7aye15I4nd wants to merge 4 commits into
cla7aye15I4nd wants to merge 4 commits into
Conversation
vszakats
reviewed
Oct 15, 2026
vszakats
reviewed
Oct 15, 2026
cla7aye15I4nd
marked this pull request as ready for review
October 15, 2026 07:32
There was a problem hiding this comment.
🟢 Approval recommended
The bounded change matches the writer’s capacity and includes regression coverage, with no unresolved findings.
0 open findings
What changed in this PR
Allows curl to reload long cookie-jar rows that its own writer can produce.
Changes:
- Raises the loader’s line cap to
DYN_APRINTF + 2, accounting for newline and terminator bytes. - Extends test 1902 to verify long and ordinary cookies reload without a transfer.
| File | Description |
|---|---|
| tests/libtest/lib1902.c | Checks explicit reload and both cookies’ presence. |
| tests/data/test1902 | Adds a long-path cookie fixture and expected output. |
| lib/cookie.c | Aligns the loader cap with the writer’s maximum output. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bagder
approved these changes
Oct 15, 2026
Member
|
Thanks! |
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.
curl -csaves accepted cookies throughcookie_output()inlib/cookie.c. It writes each Netscape cookie-jar row with the cookie's domain and path, so a row can exceedcookie_load()'s 5,048-byte line limit even when the cookie itself was accepted. A latercurl -bthen fails withCURLE_TOO_LARGEbefore sending a request.Raise the loader's line limit to
DYN_APRINTF + 2.get_netscape_format()usescurl_maprintf(), which can return at mostDYN_APRINTF - 1bytes; the writer adds up to two newline bytes on Windows, and the reader needs one byte for its terminating NUL. This lets curl reload any jar row it successfully wrote. The limit is a growth cap, not an up-front allocation.Unit 3424 covers long domain/path rows and an ordinary cookie surviving a save-and-reload round trip. A local
curl -c/curl -breproduction fails before this change and succeeds with it; the unit test and checksrc pass.