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

Re: [PATCH] fetch: download bundles once, even with --all

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 3, 2023, 18:32 UTC
Message-ID
<xmqqy1n84y1l.fsf@gitster.g>
In-Reply-To
<20230401082233.GA3503828@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 15 quoted lines
>> +	if (!uri || !*uri) {
>> +		result = 0;
>> +		goto cleanup;
>> +	}
>
> Coverity flagged this "!uri"; it can never be true since we
> unconditionally xstrdup(uri) at the top of the function, and we'd
> segfault in that case.
>
> I think the existing code that assumes a non-NULL uri is reasonable.
> Even before the xstrdup() we'd have segfaulted when it was handed to
> fetch_bundle_uri_internal().
>
> It's not a huge deal, in the sense that you're just being overly
> defensive, but the comment and conditional here are a little misleading.
Nice.  Thanks for commenting on what you spotted.
Previous: Jeff King
Message 5 of 5 in “fetch: download bundles once, even with --all”
  1. fetch: download bundles once, even with --allDerrick Stolee via GitGitGadget, Mar 31, 2023
  2. Junio C HamanoMar 31, 2023
  3. Derrick StoleeMar 31, 2023
  4. Jeff KingApr 1, 2023
  5. Junio C HamanoApr 3, 2023

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.