Re: [PATCH] fsck: do not crash on tag objects which do not contain an empty line
- From
Nicolas Pitre <nico@cam.org>
- Date
- Jun 8, 2007, 02:04 UTC
- Message-ID
- <alpine.LFD.0.99.0706072158160.12885@xanadu.home>
- In-Reply-To
- <200706080128.48637.johan@herland.net>
On Fri, 8 Jun 2007, Johan Herland wrote:
Show 7 quoted lines
> I agree that we should fail gracefully, and my code is clearly not doing > that in this case. My bad. > > But the code should also detect invalid tag objects, and in this case I'm > not yet convinced that the tag object causing the failure is in fact valid. > If someone can convince me that the blank line after headers is optional, > then I'll gladly fix the code.
That's irrelevant.
Because you are fed invalid data is no excuse for crashing.
Especially in a tool like fsck, you should _expect_ and cope with invalid data. That's why it exists in the first place: to identify such data.
Nicolas