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

Re: [PATCH] fix segv with corrupt tag object

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 26, 2019, 17:20 UTC
Message-ID
<xmqqo90bhmi3.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190826115715.GB71935@jessup.stsp.name>
Stefan Sperling <stsp@stsp.name> writes:
> The root cause of this bug seems to be that the valid assumption
> that obj->parsed implies a successfully parsed object is broken by
> parse_tag_buffer() because this function sets the 'parsed' flag even
> if errors occur during parsing.

I am mildly negative about that approach. obj->parsed is about "we've done all we need to do to attempt parsing this object" (so that next person who gets hold of the object knows that fact---one of the reasons why may be that the caller who wants to ensure that the fields are ready to be accessed does not have to spend extra cycles, but that is not the only one). Those that want to look at various fields in the object (e.g. the tagged object of a tag, the tagger identity of a tag, etc.) should be prepared to see and react to NULL in there so that they can gracefully handle "slightly" corrupt objects.

Previous: Stefan SperlingNext: Stefan Sperling
Message 4 of 8 in “fix segv with corrupt tag object”
  1. fix segv with corrupt tag objectStefan Sperling, Aug 24, 2019
  2. René ScharfeAug 25, 2019
  3. Stefan SperlingAug 26, 2019
  4. Junio C HamanoAug 26, 2019
  5. Stefan SperlingAug 26, 2019
  6. Jeff KingAug 26, 2019
  7. René ScharfeAug 29, 2019
  8. Junio C HamanoAug 30, 2019

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.