From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: Jason Cho <jason11choca@proton.me>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH] xdiff: avoid arithmetic overflow in xdl_get_hunk()
Date: Sun, 16 Mar 2025 12:53:40 -0700 [thread overview]
Message-ID: <xmqqiko8da63.fsf@gitster.g> (raw)
In-Reply-To: <8c9a3966-2746-4619-9f77-ca95797dcab8@web.de> ("René Scharfe"'s message of "Sat, 15 Mar 2025 07:38:59 +0100")
René Scharfe <l.s.r@web.de> writes:
> Am 14.03.25 um 23:28 schrieb Junio C Hamano:
>> 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, ...
Oh, no question about that, especially if the number of counted
things are somehow proportionally related to the size of in-core
memory regions in any way.
What I do *not* like is the recent trend in the patches I see. They
stop thinking there once they blindly replace int or unsigned or
whatever with size_t and the compiler stops warning. Even though
compiler warnings can be a useful tool when there is very little
false positives, they are merely tools to improve the code, but I
see more and more confused patches that seem to think squelching
warnings is the goal in itself, without thinking if the resulting
code is actually improved.
And I didn't see that in this patch. The patch was actually written
with real goal of improving the code in mind.
> but
> would be lot more effort and thus more risky.
Perhaps, perhaps not.
> Comparisons to upstream
> would become a lot more noisy as well.
I am not sure how much of that matters these days, though. Are they
still active, or is the code perfect and pretty much done? I somehow
had the impression it has been the latter for a long time...
Thanks.
next prev parent reply other threads:[~2025-03-16 19:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <xXWgbH3mlNEvFcdGLqBHwcclZoeZNPoLg8Hr6YCipHXvS5eKaHeTppzFM-l_wyB46BB1R1T0j6g_jWRXIj7-GRJh1LPxi1ta3GkQ5t8F4-0=@proton.me>
2025-03-12 15:51 ` Iffy output given git diff --unified=2147483647 Jason Cho
2025-03-14 22:00 ` [PATCH] xdiff: avoid arithmetic overflow in xdl_get_hunk() René Scharfe
2025-03-14 22:28 ` Junio C Hamano
2025-03-15 6:38 ` René Scharfe
2025-03-16 19:53 ` Junio C Hamano [this message]
2025-03-17 16:50 ` René Scharfe
2025-03-14 23:14 ` Jason Cho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqiko8da63.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jason11choca@proton.me \
--cc=l.s.r@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.