Re: [PATCH] xdiff: avoid arithmetic overflow in xdl_get_hunk()
From: René Scharfe <hidden>
Date: 2025-03-15 06:44:28
From: René Scharfe <hidden>
Date: 2025-03-15 06:44:28
Am 14.03.25 um 23:28 schrieb Junio C Hamano:
René Scharfe [off-list ref] writes:quoted
t/t4055-diff-context.sh | 10 ++++++++++ xdiff/xemit.c | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-)Oh, I love a patch like this that is well thought out to carefully check the bounds, instead of blindly say "ah, counting number of things in size_t solves everything" ;-)
Converting xdiff from long to size_t is still a good idea, I think, but would be lot more effort and thus more risky. Comparisons to upstream would become a lot more noisy as well. René