Skip to content

Commit 7183c09

Browse files
dschogitster
authored andcommitted
Fix off-by-one in read_tree_recursive
Found by valgrind. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1f9b620 commit 7183c09

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ static int match_tree_entry(const char *base, int baselen, const char *path, uns
6262
continue;
6363
/* pathspecs match only at the directory boundaries */
6464
if (!matchlen ||
65+
baselen == matchlen ||
6566
base[matchlen] == '/' ||
6667
match[matchlen - 1] == '/')
6768
return 1;

0 commit comments

Comments
 (0)