git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] connect: plug protocol capability leak

From
Jeff King <peff@peff.net>
Date
Dec 8, 2025, 20:18 UTC
Message-ID
<20251208201856.GB216526@coredump.intra.peff.net>
In-Reply-To
<xmqqfr9mnbu9.fsf@gitster.g>
On Sun, Dec 07, 2025 at 01:40:46PM +0900, Junio C Hamano wrote:
Show 13 quoted lines
> diff --git a/connect.c b/connect.c
> index 8352b71faf..c6f76e3082 100644
> --- a/connect.c
> +++ b/connect.c
> @@ -240,6 +240,8 @@ static void process_capabilities(struct packet_reader *reader, size_t *linelen)
>  	size_t nul_location = strlen(line);
>  	if (nul_location == *linelen)
>  		return;
> +
> +	free(server_capabilities_v1);
>  	server_capabilities_v1 = xstrdup(line + nul_location + 1);
>  	*linelen = nul_location;
>  
The fix looks obviously correct.

I couldn't help but notice that "v1" here is a little confusing, as it is really "v0". Or I guess if you want to be pedantic, "v1" is v0 with the extra useless version string probe that nobody actually sends. So it technically is also the v1 capabilities string, but I think v0 is more descriptive.

Anyway, way off the topic of your patch, and maybe not even worth fixing independently. I removed a couple of confusing "v1 protocol" mentions in the test suite, but I don't know if this one would actually bother anyone.

-Peff
Previous: Junio C Hamano
Message 4 of 4 in “connect: plug protocol capability leak”
  1. connect: plug protocol capability leakJunio C Hamano, Dec 7, 2025
  2. Patrick SteinhardtDec 8, 2025
  3. Junio C HamanoDec 8, 2025
  4. Jeff KingDec 8, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.