All of lore.kernel.org
 help / color / mirror / Atom feed
From: Elia Pinto <gitter.spiros@gmail.com>
To: git@vger.kernel.org
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Elia Pinto <gitter.spiros@gmail.com>,
	Patrick Steinhardt <ps@pks.im>,
	Neeraj Singh <neerajsi@microsoft.com>,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	Junio C Hamano <gitster@pobox.com>,
	Michael Montalbo <mmontalbo@gmail.com>
Subject: [PATCH 0/3] use size_t for a few sizes that are 32 bits everywhere
Date: Sun,  1 Nov 2026 16:36:48 +0100	[thread overview]
Message-ID: <cover.1793546752.git.gitter.spiros@gmail.com> (raw)

Unlike the previous series, these aren't about "long" on Windows: the
types involved ("uint32_t", "int", "unsigned int") are 32 bits on every
platform. They were found by scanning a native 64-bit Linux build with
-Wshorten-64-to-32. That scan sees the "unsigned long" -> 32-bit
conversions that a Windows target can't see, because there "long" is
already 32 bits.

- 1/3 hashwrite(): a corrupt pack when pack-objects writes a compressed
  buffer of 4GiB or more in one call;
- 2/3 count_lines(): a wrong diff -B --stat for files of 2GiB or more;
- 3/3 hash_chars(): renames of files of 4GiB or more aren't recognised.

No tests, because they need GiB-sized inputs; each was verified by
simulating the truncation at 16 bits.

The other results of that scan are bounded by the format or by the input
(options, masks, line lengths, xdiff limited to 1023MiB). It doesn't
depend on the other series in flight and merges cleanly with them. Based
on master 50fe5cc63f.

Elia Pinto (3):
  csum-file: use size_t for the count passed to hashwrite()
  diff: use size_t for the size passed to count_lines()
  diffcore-delta: use size_t for the size of the buffer to hash

 csum-file.c      | 2 +-
 csum-file.h      | 2 +-
 diff.c           | 2 +-
 diffcore-delta.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)


base-commit: 50fe5cc63f9cd6e89b87a2c9ccf96a444f4cfdb7
-- 
2.53.0


             reply	other threads:[~2026-11-01 15:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-01 15:36 Elia Pinto [this message]
2026-11-01 15:36 ` [PATCH 1/3] csum-file: use size_t for the count passed to hashwrite() Elia Pinto
2026-11-01 15:36 ` [PATCH 2/3] diff: use size_t for the size passed to count_lines() Elia Pinto
2026-11-04 13:58   ` Phillip Wood
2026-11-04 15:45     ` Phillip Wood
2026-11-01 15:36 ` [PATCH 3/3] diffcore-delta: use size_t for the size of the buffer to hash Elia Pinto
2026-11-17 10:37 ` [PATCH v2 0/4] widen a few sizes and counts that are 32 bits everywhere Elia Pinto
2026-11-17 10:37   ` [PATCH v2 1/4] csum-file: use size_t for the count passed to hashwrite() Elia Pinto
2026-11-17 17:52     ` Junio C Hamano
2026-11-17 23:50       ` brian m. carlson
2026-11-17 10:37   ` [PATCH v2 2/4] diff: use size_t for sizes and line counts of complete rewrites Elia Pinto
2026-11-17 10:37   ` [PATCH v2 3/4] diffcore-delta: use size_t for the size of the buffer to hash Elia Pinto
2026-11-17 23:21     ` Junio C Hamano
2026-11-17 10:37   ` [PATCH v2 4/4] diff: use uintmax_t for diffstat totals and graph scaling Elia Pinto
2026-11-17 16:36     ` Torsten Bögershausen
2026-11-17 23:13     ` Junio C Hamano

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=cover.1793546752.git.gitter.spiros@gmail.com \
    --to=gitter.spiros@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mmontalbo@gmail.com \
    --cc=neerajsi@microsoft.com \
    --cc=ps@pks.im \
    --cc=sandals@crustytoothpaste.net \
    /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.