public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jeff King <peff@peff•net>
To: Anders Kaseorg <andersk@mit•edu>
Cc: Toon Claes <toon@iotcl•com>,
	git@vger•kernel.org, Karthik Nayak <karthik.188@gmail•com>
Subject: Re: [PATCH] last-modified: fix bug caused by inproper initialized memory
Date: Sat, 29 Nov 2025 05:50:23 -0500	[thread overview]
Message-ID: <20251129105023.GA646133@coredump.intra.peff.net> (raw)
In-Reply-To: <5699f2cc-5157-441e-af98-4d8df492ec72@mit.edu>

On Fri, Nov 28, 2025 at 02:20:22PM -0800, Anders Kaseorg wrote:

> On 11/28/25 12:55, Jeff King wrote:
> > In the same vein, probably using "sizeof(lm->scratch->words)" is better
> > than "sizeof(eword_t)". But again, I find it an unlikely detail for us
> > to catch under the hood.
> 
> As words is a pointer, you must have meant sizeof *lm->scratch->words or
> sizeof lm->scratch->words[0].

Whoops, yes. I prefer sizeof(*var) over sizeof(type) because it tracks
changes to the type of "var" automatically. But the opportunity to
forget the "*" is perhaps a point against it. :)

-Peff

  reply	other threads:[~2025-11-29 10:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-28 16:37 [PATCH] last-modified: fix bug caused by inproper initialized memory Toon Claes
2025-11-28 20:55 ` Jeff King
2025-11-28 22:20   ` Anders Kaseorg
2025-11-29 10:50     ` Jeff King [this message]
2025-12-08 11:47   ` Toon Claes
2025-12-08 20:15     ` Jeff King
2025-12-08 22:42       ` Junio C Hamano
2025-11-29  2:01 ` Junio C Hamano
2025-11-29  2:11   ` Junio C Hamano
2025-11-29  9:38     ` Toon Claes
2025-12-08 11:46 ` [PATCH v2] last-modified: fix use of uninitialized memory Toon Claes
2025-12-08 13:26   ` Junio C Hamano
2025-12-09  8:43     ` Toon Claes
2025-12-09 12:18       ` 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=20251129105023.GA646133@coredump.intra.peff.net \
    --to=peff@peff$(echo .)net \
    --cc=andersk@mit$(echo .)edu \
    --cc=git@vger$(echo .)kernel.org \
    --cc=karthik.188@gmail$(echo .)com \
    --cc=toon@iotcl$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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