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
This commit is contained in:
commit
e44da1bbb8
@ -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…
Reference in New Issue
Block a user