Commit 6cacd44bd036e9987134a4f43fee33dc1acb447b

Vicent Martí 2012-12-12T06:47:50

Merge pull request #1136 from pclouds/tree-cache-counts tree cache: loosen negative entry count check

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/tree-cache.c b/src/tree-cache.c
index 8d186d2..d6ecfbc 100644
--- a/src/tree-cache.c
+++ b/src/tree-cache.c
@@ -104,7 +104,7 @@ static int read_tree_internal(git_tree_cache **out,
 	tree->name[name_len] = '\0';
 
 	/* Blank-terminated ASCII decimal number of entries in this tree */
-	if (git__strtol32(&count, buffer, &buffer, 10) < 0 || count < -1)
+	if (git__strtol32(&count, buffer, &buffer, 10) < 0)
 		goto corrupted;
 
 	tree->entries = count;