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

From: Junio C Hamano <[email-masked]>
Date: Sat, 19 Jan 2008 11:52:47 -0800

Martin Koegler <[email-masked]> 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.