Re: [PATCH/RFC v3 04/12] pack-objects: use bitfield for object_entry::depth
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 9, 2018, 23:07 UTC
- Message-ID
- <xmqqbmfw4zmg.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180308114232.10508-5-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 6 quoted lines
> + Maximum value is 4095.
> ...
> + if (depth > (1 << OE_DEPTH_BITS))
> + die(_("delta chain depth %d is greater than maximum limit %d"),
> + depth, (1 << OE_DEPTH_BITS));
> +Do I see an off-by-one here? Ie.
if ((1 << OE_DEPATH_BITS) <= depth)
die("depth that is 4096 or deeper is too much");