Skip to content

serve: reject valueless promisor-remote capability - #2199

Open
newren wants to merge 1 commit into
gitgitgadget:masterfrom
newren:promisor-remote-require-argument
Open

serve: reject valueless promisor-remote capability#2199
newren wants to merge 1 commit into
gitgitgadget:masterfrom
newren:promisor-remote-require-argument

Conversation

@newren

@newren newren commented Aug 11, 2026

Copy link
Copy Markdown

cc: Elijah Newren newren@gmail.com

d460267 (Add 'promisor-remote' capability to protocol v2,
2025-02-18) added a receive callback which passes the capability value
directly to mark_promisor_remotes_as_accepted(). However, a client can
send the capability name without an '=' or value, in which case
get_capability() supplies NULL and strbuf_split_str() dereferences it.

Reject the missing argument before parsing it, and add a test covering
this case.

Signed-off-by: Elijah Newren <newren@gmail.com>
@newren

newren commented Aug 12, 2026

Copy link
Copy Markdown
Author

/submit

@gitgitgadget

gitgitgadget Bot commented Aug 12, 2026

Copy link
Copy Markdown

Submitted as pull.2199.git.1786516783909.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-2199/newren/promisor-remote-require-argument-v1

To fetch this version to local tag pr-2199/newren/promisor-remote-require-argument-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-2199/newren/promisor-remote-require-argument-v1

@gitgitgadget

gitgitgadget Bot commented Aug 12, 2026

Copy link
Copy Markdown

Elijah Newren wrote on the Git mailing list (how to reply to this email):

On Tue, Aug 11, 2026 at 11:39 PM Elijah Newren via GitGitGadget
<gitgitgadget@gmail.com> wrote:
>
> From: Elijah Newren <newren@gmail.com>
>
> d460267613da (Add 'promisor-remote' capability to protocol v2,
> 2025-02-18) added a receive callback which passes the capability value
> directly to mark_promisor_remotes_as_accepted(). However, a client can
> send the capability name without an '=' or value, in which case
> get_capability() supplies NULL and strbuf_split_str() dereferences it.

Oops, I previously forgot to CC Christian as the author of
d460267613da.  Doing that now.

@gitgitgadget

gitgitgadget Bot commented Aug 12, 2026

Copy link
Copy Markdown

User Elijah Newren <newren@gmail.com> has been added to the cc: list.

@gitgitgadget

gitgitgadget Bot commented Aug 13, 2026

Copy link
Copy Markdown

This branch is now known as en/serve-promisor-remote-fix.

@gitgitgadget

gitgitgadget Bot commented Aug 13, 2026

Copy link
Copy Markdown

This patch series was integrated into seen via git@9737e16.

@gitgitgadget gitgitgadget Bot added the seen label Aug 13, 2026
@gitgitgadget

gitgitgadget Bot commented Aug 13, 2026

Copy link
Copy Markdown

There was a status update in the "New Topics" section about the branch en/serve-promisor-remote-fix on the Git mailing list:

A client requesting the promisor-remote capability without a value
caused a null pointer dereference, which has been corrected by
rejecting a request without an argument.

Needs review.
source: <pull.2199.git.1786516783909.gitgitgadget@gmail.com>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant