git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] last-modified: fix bug caused by inproper initialized memory

From
Jeff King <peff@peff.net>
Date
Nov 29, 2025, 10:50 UTC
Message-ID
<20251129105023.GA646133@coredump.intra.peff.net>
In-Reply-To
<5699f2cc-5157-441e-af98-4d8df492ec72@mit.edu>
On Fri, Nov 28, 2025 at 02:20:22PM -0800, Anders Kaseorg wrote:
Show 7 quoted lines
> 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
Previous: Anders KaseorgNext: Toon Claes
Message 4 of 14 in “last-modified: fix bug caused by inproper initialized memory”
  1. last-modified: fix bug caused by inproper initialized memoryToon Claes, Nov 28, 2025
  2. Jeff KingNov 28, 2025
  3. Anders KaseorgNov 28, 2025
  4. Jeff KingNov 29, 2025
  5. Toon ClaesDec 8, 2025
  6. Jeff KingDec 8, 2025
  7. Junio C HamanoDec 8, 2025
  8. Junio C HamanoNov 29, 2025
  9. Junio C HamanoNov 29, 2025
  10. Toon ClaesNov 29, 2025
  11. last-modified: fix use of uninitialized memoryToon Claes, Dec 8, 2025
  12. Junio C HamanoDec 8, 2025
  13. Toon ClaesDec 9, 2025
  14. Junio C HamanoDec 9, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.