From: Junio C Hamano Date: Fri, 23 Oct 2026 18:49:37 GMT Subject: Re: [PATCH v2] diff-delta: use safe integer arithmetic Message-ID: In-Reply-To: Phillip Wood writes: >> + memsize = st_add3(sizeof(*index), >> + st_mult(sizeof(*packed_hash), hsize + 1), > > What are the bounds of hsize? Can adding one to it overflow? The > alignment is off here as well, all the arguments to st_add3() should be > aligned. Very good question, and I think hsize is capped at 1^26 in a code early in this function, which makes this safe. It needs to be explained why it is safe in the log message, though.