Re: [PATCH v2 2/2] rev-parse: use selected alternate terms too look up refs
- From
- Jonas Rebmann <kernel@schlaraffenlan.de>
- Date
- Mar 24, 2026, 12:30 UTC
- Message-ID
- <888f8670-856a-4ce7-8177-da78ba4f0c8a@schlaraffenlan.de>
- In-Reply-To
- <d366fc82-efcc-46cb-9536-cd38b1fd18d4@gmail.com>
Hi Phillip,
Thank you for your feedback, it will be addressed in v3.
On 24/03/2026 11.49, Phillip Wood wrote:
> If we fail to read the terms because there is no bisect in progress > then term_bad and term_good will be NULL and so the next line will > segfault.
My understanding of read_bisect_terms() was that it never sets the terms to NULL, that if no bisect is in progress, .git/BISECT_TERMS does not exist, and the terms default to "good"/"bad" here in bisect.c:
if (errno == ENOENT) {
free(*read_bad);
*read_bad = xstrdup("bad");
free(*read_good);
*read_good = xstrdup("good");
return;
} else {
die_errno(_("could not read file '%s'"), filename);
}So is a NULL-check really needed on caller end?
Regards, Jonas