diff options
| author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2026-06-18 13:50:18 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-06-18 09:46:56 -0700 |
| commit | ab3810eb6fffd95d39e9579945e360e8247eeda8 (patch) | |
| tree | 1ab0403733a3fe95c644a10f799d233168848fa3 /t/t4013/diff.diff_initial..side | |
| parent | 7a094d68a27e321a99c8ab6b700909e503904bd9 (diff) | |
zlib: properly clamp to uLong
On platforms where `unsigned long` and `size_t` differ in bit size, we
want to clamp the buffers we pass to zlib to the former's size, as per
d05d666977 (git-zlib: handle data streams larger than 4GB, 2026-05-08).
The logic introduced in that commit performs a clamping to the bits,
though, which fails to do what is needed here: If too many bytes are
available in the buffers, we need to clamp to the maximum value of an
`unsigned long`. Otherwise, we ask zlib to use too small buffers, in the
worst case using 0 as the size (think: a value whose 32 lowest bits are
all zero).
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff_initial..side')
0 files changed, 0 insertions, 0 deletions
