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

Re: [PATCH] string_list_append: always set util pointer to NULL

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 12, 2011, 07:43 UTC
Message-ID
<7v4o89zoi1.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110212051850.GA715@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 14 quoted lines
> It is not immediately obvious that the util field may
> contain random bytes after appending an item. Especially
> since the string_list_insert* functions _do_ explicitly zero
> the util pointer.
>
> This does not appear to be a bug in any current git code, as
> all callers either fill in the util field immediately or
> never use it. However, it is worth it to be less surprising
> to new users of the string-list API who may expect it to be
> intialized to NULL.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> This bit me in some new code I was writing. I consider it a bug fix, but ...
Of course; the "Especially since" part is very convincing.
Previous: Jeff King
Message 2 of 2 in “string_list_append: always set util pointer to NULL”
  1. string_list_append: always set util pointer to NULLJeff King, Feb 12, 2011
  2. Junio C HamanoFeb 12, 2011

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.