Thread (1 message) 1 message, 1 author, 2024-06-14

Re: [PATCH 2/2] pack-bitmap.c: ensure pseudo-merge offset reads are bounded

From: Junio C Hamano <hidden>
Date: 2024-06-14 18:23:27

Taylor Blau [off-list ref] writes:
On Thu, Jun 06, 2024 at 03:35:51PM -0700, Junio C Hamano wrote:
quoted
Taylor Blau [off-list ref] writes:
quoted
On Thu, Jun 06, 2024 at 12:42:59PM -0700, Junio C Hamano wrote:
quoted
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.
Ah. Thanks for the clarification. Yes, I think you could do so; I'm
happy to send another version if you like.
Let's get this thing unstuck; the other larger topic that this topic
builds upon is stuck for too long.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help