From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"René Scharfe" <l.s.r@web.de>, "Git List" <git@vger.kernel.org>
Subject: Re: [PATCH v2] bisect--helper: plug strvec leak
Date: Fri, 14 Oct 2022 13:23:36 -0700 [thread overview]
Message-ID: <xmqqczau888n.fsf@gitster.g> (raw)
In-Reply-To: <Y0m8AU+Yf7PREI2E@coredump.intra.peff.net> (Jeff King's message of "Fri, 14 Oct 2022 15:44:01 -0400")
Jeff King <peff@peff.net> writes:
> On Tue, Oct 11, 2022 at 02:43:24PM -0700, Junio C Hamano wrote:
>
>> > - if (run_command_v_opt(argv.v, RUN_GIT_CMD)) {
>> > + if (run_command_opt_l(RUN_GIT_CMD, "-C", repo, "sparse-checkout",
>> > + "set", NULL)) {
>>
>> And this does give us protection from the "Programmers can give
>> unterminated list to run_command_v_opt() by mistake", which is not
>> really solved mechanically even if the list is prepared with the
>> strvec API (because the compiler has to be smart enough to know that
>> argv.v was prepared with proper use of the API), which is nice.
>
> Yeah, I agree this addresses the point I raised (which I am somewhat
> regretting raising, as IMHO it was not worth the amount of discussion
> that has ensued).
>
> Since nobody asked, my _real_ opinion is that I prefer René's original
> that used an actual struct, and its auto-freeing strvec.
Yup, it was you who worried about forgotten NULL at the end, though
;-)
next prev parent reply other threads:[~2022-10-14 20:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-04 16:06 PATCH] bisect--helper: plug strvec leak in bisect_start() René Scharfe
2022-10-05 7:29 ` Ævar Arnfjörð Bjarmason
2022-10-05 15:43 ` René Scharfe
2022-10-05 19:44 ` Junio C Hamano
2022-10-06 21:35 ` Ævar Arnfjörð Bjarmason
2022-10-06 21:53 ` Junio C Hamano
2022-10-07 15:08 ` [PATCH v2] bisect--helper: plug strvec leak René Scharfe
2022-10-07 17:21 ` Junio C Hamano
2022-10-11 2:39 ` Jeff King
2022-10-11 5:42 ` Junio C Hamano
2022-10-11 7:29 ` Ævar Arnfjörð Bjarmason
2022-10-11 13:21 ` Jeff King
2022-10-11 13:20 ` Jeff King
2022-10-11 17:11 ` Junio C Hamano
2022-10-11 18:13 ` Ævar Arnfjörð Bjarmason
2022-10-11 21:43 ` Junio C Hamano
2022-10-14 19:44 ` Jeff King
2022-10-14 20:23 ` Junio C Hamano [this message]
2022-10-15 6:51 ` René Scharfe
2022-10-15 18:21 ` Jeff King
2022-10-05 19:41 ` PATCH] bisect--helper: plug strvec leak in bisect_start() Junio C Hamano
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=xmqqczau888n.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=l.s.r@web.de \
--cc=peff@peff.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).