From: Junio C Hamano <gitster@pobox.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
Elijah Newren <newren@gmail.com>,
Patrick Steinhardt <ps@pks.im>
Subject: Re: [PATCH 2/2] pack-bitmap.c: ensure pseudo-merge offset reads are bounded
Date: Thu, 06 Jun 2024 15:35:51 -0700 [thread overview]
Message-ID: <xmqqjzj1k8c8.fsf@gitster.g> (raw)
In-Reply-To: <ZmI3RYSsx6VRHdc9@nand.local> (Taylor Blau's message of "Thu, 6 Jun 2024 18:25:09 -0400")
Taylor Blau <me@ttaylorr.com> writes:
> On Thu, Jun 06, 2024 at 12:42:59PM -0700, Junio C Hamano wrote:
>> Can table_size at this point be smaller than 24, which will allow
>> (table_size - 24) to be a huge number that st_mult() will
>> comfortably fit?
>
> It could be smaller than 24, but I think we're at the point of
> diminishing returns here.
I only meant to say that we could easily rewrite
if (st_mult() > table_size - 24)
condition to
if (st_add(st_mult(), 24) > table_size)
and we do not have to think if we have already checked table_size
before we reach this point of the control flow.
next prev parent reply other threads:[~2024-06-06 22:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 18:40 [PATCH 1/2] Documentation/technical/bitmap-format.txt: add missing position table Taylor Blau
2024-06-06 18:41 ` [PATCH 2/2] pack-bitmap.c: ensure pseudo-merge offset reads are bounded Taylor Blau
2024-06-06 19:42 ` Junio C Hamano
2024-06-06 22:25 ` Taylor Blau
2024-06-06 22:35 ` Junio C Hamano [this message]
2024-06-06 22:38 ` Taylor Blau
2024-06-14 18:23 ` Junio C Hamano
2024-06-14 19:23 ` [PATCH v2 0/2] pseudo-merge: various small fixes Taylor Blau
2024-06-14 19:23 ` [PATCH v2 1/2] Documentation/technical/bitmap-format.txt: add missing position table Taylor Blau
2024-06-14 19:23 ` [PATCH v2 2/2] pack-bitmap.c: ensure pseudo-merge offset reads are bounded Taylor Blau
2024-06-14 21:08 ` [PATCH v2 0/2] pseudo-merge: various small fixes Elijah Newren
2024-06-14 21:23 ` 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=xmqqjzj1k8c8.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=me@ttaylorr.com \
--cc=newren@gmail.com \
--cc=peff@peff.net \
--cc=ps@pks.im \
/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.