diff: widen deflate_it()'s bound local from int to size_t

Fixes a pre-existing silent narrowing from `git_deflate_bound()`'s
`unsigned long` return into an `int` local: anything past 2 GiB has
always wrapped negative here and then been re-extended to `size_t`
inside `xmalloc()`. Also prep for the upcoming `git_deflate_bound()`
widening to `size_t`, which would extend the narrowing further if
`bound` stayed `int`.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin
2026-07-09 16:49:36 +00:00
committed by Junio C Hamano
parent 075b33feee
commit a741ef9611

2
diff.c
View File

@@ -3609,7 +3609,7 @@ static unsigned char *deflate_it(char *data,
unsigned long size,
unsigned long *result_size)
{
int bound;
size_t bound;
unsigned char *deflated;
git_zstream stream;
struct repo_config_values *cfg = repo_config_values(the_repository);