From: Junio C Hamano Date: Sat, 25 Aug 2007 17:56:09 GMT Subject: Re: [PATCH] Don't segfault if we failed to inflate a packed delta Message-ID: <7v8x7z5why.fsf@gitster.siamese.dyndns.org> In-Reply-To: Linus Torvalds writes: > Hmm. We should actually make "unpack_entry()" return print an error and > return NULL for these cases, rather than die, I think. > > Most of the callers seem to already check for NULL (not "load_tree()" in > fast-import.c), but for something like fsck, while "die()" is obviously > better than a SIGSEGV, we should probably continue and try to see what > else we find. > > (Although, to be honest, it might not matter. If your pack-file is corrupt > enough for this to trigger, there's seldom anything interesting fsck will > tell, so in practical terms this probably isn't a big deal). But if the delta does not apply we already die(). Last night I and Shawn actually were wondering if it makes sense to have unpack_entry() die -- quite the opposite of being nicer to fsck.