From 08698b1e32bc414f214b7300b40c30a30d9ecd1c Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Wed, 29 Oct 2008 19:02:49 -0400 Subject: make find_pack_revindex() aware of the nasty world It currently calls die() whenever given offset is not found thinking that such thing should never happen. But this offset may come from a corrupted pack whych _could_ happen and not be found. Callers should deal with this possibility gracefully instead. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- pack-revindex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pack-revindex.c') diff --git a/pack-revindex.c b/pack-revindex.c index 6096b6224..1de53c893 100644 --- a/pack-revindex.c +++ b/pack-revindex.c @@ -140,7 +140,8 @@ struct revindex_entry *find_pack_revindex(struct packed_git *p, off_t ofs) else lo = mi + 1; } while (lo < hi); - die("internal error: pack revindex corrupt"); + error("bad offset for revindex"); + return NULL; } void discard_revindex(void) -- cgit v1.2.1