Browse Source

Merge branch 'jk/cache-tree-protect-from-broken-libgit2'

The code to use cache-tree trusted the on-disk data too much
and fell into an infinite loop.

* jk/cache-tree-protect-from-broken-libgit2:
  cache-tree: avoid infinite loop on zero-entry tree
maint
Junio C Hamano 10 years ago
parent
commit
e44da1bbb8
  1. 2
      cache-tree.c

2
cache-tree.c

@ -303,6 +303,8 @@ static int update_one(struct cache_tree *it, @@ -303,6 +303,8 @@ static int update_one(struct cache_tree *it,
flags);
if (subcnt < 0)
return subcnt;
if (!subcnt)
die("index cache-tree records empty sub-tree");
i += subcnt;
sub->count = subcnt; /* to be used in the next loop */
*skip_count += subskip;

Loading…
Cancel
Save