Git development
 help / color / mirror / Atom feed
From: Aniket Gupta <aniketgupta3001@gmail.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: m@suozzo.co, git@vger.kernel.org, gitgitgadget@gmail.com
Subject: Re: [PATCH] reftable/record: bound an object record's offset count by its length
Date: Tue, 20 Oct 2026 16:54:42 +0000	[thread overview]
Message-ID: <20261020165442.59954-1-aniketgupta3001@gmail.com> (raw)
In-Reply-To: <atcKOhm0Kd5XryAg@pks.im>

Hi Matthew,

> By fixing that one function we also implicitly fix all the other
> callers that may currently be wrong.

I tried Patrick's change on a 32 bit build and it works for
REFTABLE_ALLOC_ARRAY. However REFTABLE_CALLOC_ARRAY goes straight to
reftable_calloc() with a size_t and gets truncated. I think no one
passes a 64 bit count to it so nothing breaks but maybe worth a
mention in the commit message?

Also the new test passes because of the count > in.len check. If
that check goes away in v2 I think it might need a different test
since on 64 bit nothing truncates. Maybe we can test
reftable_alloc_size() directly?

Aniket

      parent reply	other threads:[~2026-10-20 16:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 14:58 [PATCH] reftable/record: bound an object record's offset count by its length Matthew Suozzo via GitGitGadget
2026-10-19  7:46 ` Patrick Steinhardt
2026-10-19 17:14   ` m
2026-10-20  6:29     ` Patrick Steinhardt
2026-10-20 15:08       ` Junio C Hamano
2026-10-20 15:10         ` Patrick Steinhardt
2026-10-20 16:54       ` Aniket Gupta [this message]

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=20261020165442.59954-1-aniketgupta3001@gmail.com \
    --to=aniketgupta3001@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=m@suozzo.co \
    --cc=ps@pks.im \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox