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

Re: [PATCH] parse_commit_buffer: don't parse invalid commits

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 19, 2008, 19:52 UTC
Message-ID
<7vprvx8ueo.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1200764123283-git-send-email-mkoegler@auto.tuwien.ac.at>
Martin Koegler <mkoegler@auto.tuwien.ac.at> writes:
> * check, that the tree line ends with \n
Ok.
> * prevent parse_commit_date from reading beyond the buffer,
>   - if author line does not end with \n
>   - if committer line does not contain >
"even if" would be nicer, I think.
> * verify in parse_commit_date, that the commiter line ends with \n

Perhaps an additional note to leave for people who will later be tempted to touch this part of the code is needed; otherwise the time spent on the thread goes wasted.

 * keep the existing behaviour to return a commit object even
   when non-structural fields such as committer and author are
   malformed, so that tools that need to look at commits to
   clean up a history with such broken commits can still get at
   the structural data (i.e. the parents chain and the tree
   object).

No need to resend if you allow me to amend the patch along the above lines (please just say so), or you could resend with improvements on your own.

Thanks.
Previous: Martin KoeglerNext: Martin Koegler
Message 2 of 3 in “parse_commit_buffer: don't parse invalid commits”
  1. parse_commit_buffer: don't parse invalid commitsMartin Koegler, Jan 19, 2008
  2. Junio C HamanoJan 19, 2008
  3. Martin KoeglerJan 20, 2008

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.