Re: [PATCH] xdiff: avoid arithmetic overflow in xdl_get_hunk()
- From
René Scharfe <l.s.r@web.de>
- Date
- Mar 15, 2025, 06:38 UTC
- Message-ID
- <8c9a3966-2746-4619-9f77-ca95797dcab8@web.de>
- In-Reply-To
- <xmqqikobdz7l.fsf@gitster.g>
Am 14.03.25 um 23:28 schrieb Junio C Hamano:
Show 9 quoted lines
> René Scharfe <l.s.r@web.de> writes: > >> 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é