From: Johannes Schindelin Date: Mon, 08 Dec 2014 11:35:27 GMT Subject: Re: [PATCH] fsck: properly bound "invalid tag name" error message Message-ID: In-Reply-To: <20141208112835.GA15919@lanh> Hi Duy, On Mon, 8 Dec 2014, Duy Nguyen wrote: > On Mon, Dec 08, 2014 at 12:57:06AM -0500, Jeff King wrote: > > I do admit that I am tempted to teach index-pack to always NUL-terminate > > objects in memory that we feed to fsck, just to be on the safe side. It > > doesn't cost much, and could prevent a silly mistake (either in the > > future, or one that I missed in my analysis). > > I think I'm missing a "but.." here. The "but..."s I have are: 1) we potentially waste space, and 2) I would like to make really certain, preferably with static analysis, that fsck_object() only receives buffers that are NUL terminated, and that no call path is missed. The patch looks good, of course, but I lack the broad overview of Git's source code - it has been years since I was familiar enough with it to know the places touching particular functions from the top of my head. Ciao, Dscho