Re: [PATCH 4/5] pack-objects: support excluded-open packs with --stdin-packs
- From
Jeff King <peff@peff.net>
- Date
- Mar 21, 2026, 16:57 UTC
- Message-ID
- <20260321165711.GA718452@coredump.intra.peff.net>
- In-Reply-To
- <bd78919e19cfa968556ad4241391120ed56e9dce.1773959041.git.me@ttaylorr.com>
On Thu, Mar 19, 2026 at 06:24:25PM -0400, Taylor Blau wrote:
Show 9 quoted lines
> @@ -3750,8 +3756,6 @@ static int add_object_entry_from_pack(const struct object_id *oid,
> return 0;
>
> ofs = nth_packed_object_offset(p, pos);
> - if (!want_object_in_pack(oid, 0, &p, &ofs))
> - return 0;
>
> if (p) {
> struct object_info oi = OBJECT_INFO_INIT;I haven't read all of the patches carefully yet, but Coverity observed that without this call to want_object_in_pack(), we are left with "p" that came from the caller. If that "p" is ever NULL, then the nth_packed_object_offset() call above will segfault. But if it is not, then the "if (p)" below is pointless.
AFAICT it will never be NULL, and the conditional is now pointless. But it wasn't before your patch, since want_object_in_pack() may set the found_pack to NULL if the object is not wanted.
-Peff