Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jk/cache-tree-protect-from-broken-libgit2'
author
Junio C Hamano
<gitster@pobox.com>
Thu, 6 Nov 2014 18:51:35 +0000
(10:51 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 6 Nov 2014 18:51:35 +0000
(10:51 -0800)
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
cache-tree.c
patch
|
blob
|
history
raw
(from parent 1:
f745acb
)
diff --git
a/cache-tree.c
b/cache-tree.c
index 215202c42d2243ebf704ac083937d65aa8497929..32772b95644d2f32841984b25b685379c6914ad4 100644
(file)
--- a/
cache-tree.c
+++ b/
cache-tree.c
@@
-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;