X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=reachable.c;h=3b1c18ff9b9060d0dd437ce89aedb8871c66c54c;hb=d3a7b8f5c5ed2a073936e09aa80c8a0b0cf10f5c;hp=11499a60c4202ba29b2dfc8bf1e6536343dfed4c;hpb=cc36934791f3857b62348b6a9e071cdf989a9177;p=git.git diff --git a/reachable.c b/reachable.c index 11499a60c..3b1c18ff9 100644 --- a/reachable.c +++ b/reachable.c @@ -15,6 +15,8 @@ static void process_blob(struct blob *blob, { struct object *obj = &blob->object; + if (!blob) + die("bad blob object"); if (obj->flags & SEEN) return; obj->flags |= SEEN; @@ -39,6 +41,8 @@ static void process_tree(struct tree *tree, struct name_entry entry; struct name_path me; + if (!tree) + die("bad tree object"); if (obj->flags & SEEN) return; obj->flags |= SEEN; @@ -178,7 +182,7 @@ static void add_cache_refs(struct rev_info *revs) * lookup_blob() on them, to avoid populating the hash table * with invalid information */ - if (S_ISGITLINK(ntohl(active_cache[i]->ce_mode))) + if (S_ISGITLINK(active_cache[i]->ce_mode)) continue; lookup_blob(active_cache[i]->sha1); @@ -217,6 +221,7 @@ void mark_reachable_objects(struct rev_info *revs, int mark_reflog) * Set up the revision walk - this will move all commits * from the pending list to the commit walking list. */ - prepare_revision_walk(revs); + if (prepare_revision_walk(revs)) + die("revision walk setup failed"); walk_commit_list(revs); }