From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, vdye@github.com,
Derrick Stolee <derrickstolee@github.com>
Subject: Re: [PATCH] fetch: download bundles once, even with --all
Date: Mon, 03 Apr 2023 11:32:06 -0700 [thread overview]
Message-ID: <xmqqy1n84y1l.fsf@gitster.g> (raw)
In-Reply-To: <20230401082233.GA3503828@coredump.intra.peff.net> (Jeff King's message of "Sat, 1 Apr 2023 04:22:33 -0400")
Jeff King <peff@peff.net> writes:
>> + 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.
prev parent reply other threads:[~2023-04-03 18:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-31 15:59 [PATCH] fetch: download bundles once, even with --all Derrick Stolee via GitGitGadget
2023-03-31 17:06 ` Junio C Hamano
2023-03-31 18:09 ` Derrick Stolee
2023-04-01 8:22 ` Jeff King
2023-04-03 18:32 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqy1n84y1l.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=peff@peff.net \
--cc=vdye@github.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.