Re: [RFC PATCH 00/10] range-diff: fix segfault due to integer overflow
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 10, 2021, 14:31 UTC
- Message-ID
- <nycvar.QRO.7.76.6.2112101528200.90@tvgsbejvaqbjf.bet>
- In-Reply-To
- <RFC-cover-00.10-00000000000-20211209T191653Z-avarab@gmail.com>
Hi Ævar,
On Thu, 9 Dec 2021, Ævar Arnfjörð Bjarmason wrote:
> The difference between "master" and "git-for-windows/main" is large > enough that comparing the two will segfault on my system. This is > because the range-diff code does some expensive calculations and will > overflow the "int" type.
You are holding this thing wrong.
The `main` branch of Git for Windows uses merging rebases, therefore you need to use a commit range like `git-for-windows/main^{/^Start.the.merging}..git-for-windows/main` and compare it to `git-for-windows/main..master`.
Failing that, you will receive only bogus results.
As to the patch series, it likely does the wrong thing. Just like we error out on insanely large input in libxdiff, `range-diff` should do the same.
Ciao, Johannes