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:
@ -303,6 +303,8 @@ static int update_one(struct cache_tree *it,
|
|||||||
flags);
|
flags);
|
||||||
if (subcnt < 0)
|
if (subcnt < 0)
|
||||||
return subcnt;
|
return subcnt;
|
||||||
|
if (!subcnt)
|
||||||
|
die("index cache-tree records empty sub-tree");
|
||||||
i += subcnt;
|
i += subcnt;
|
||||||
sub->count = subcnt; /* to be used in the next loop */
|
sub->count = subcnt; /* to be used in the next loop */
|
||||||
*skip_count += subskip;
|
*skip_count += subskip;
|
||||||
|
Reference in New Issue
Block a user