Skip to content

easy: fix duplicating a zero byte memory area - #22893

Closed
bagder wants to merge 4 commits into
masterfrom
bagder/dup-zero-copypost
Closed

bagder wants to merge 4 commits into
masterfrom
bagder/dup-zero-copypost

Conversation

@bagder

@bagder bagder commented Sep 10, 2026

Copy link
Copy Markdown
Member

Added test 1791 to reproduce and verify fix.

Reported-by: Max Dymond

Added test 1791 to reproduce and verify fix.

Reported-by: Max Dymond
@github-actions github-actions Bot added the tests label Sep 10, 2026
@bagder
bagder marked this pull request as ready for review September 10, 2026 07:01
@bagder
bagder requested a balanced review from Copilot September 10, 2026 07:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The clone retains a source-owned pointer, and the regression test does not fail when duplication fails.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Optimizes duplication of zero-length copied POST data and adds regression coverage.

Changes:

  • Avoids allocating when duplicating zero-byte POST fields.
  • Registers test 1791 for the duplication scenario.
File summaries
File Description
lib/easy.c Skips zero-length POST-field allocation.
tests/libtest/lib1791.c Adds duplication regression test.
tests/libtest/Makefile.inc Registers the test executable.
tests/data/test1791 Defines the test case.
tests/data/Makefile.am Registers test 1791.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/easy.c Outdated
Comment thread tests/libtest/lib1791.c
@bagder bagder changed the title easy: duplicating a zero byte memory area needs no malloc easy: fix duplicating a zero byte memory area Sep 10, 2026
@bagder
bagder requested a balanced review from Copilot September 10, 2026 07:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The targeted fix correctly preserves zero-length copied POST fields and includes an appropriate regression test.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@bagder bagder closed this in 7d7fa4d Sep 10, 2026
@bagder
bagder deleted the bagder/dup-zero-copypost branch September 25, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants