Skip to content

Commit

Permalink
Fix off-by-one in read_tree_recursive
Browse files Browse the repository at this point in the history
Found by valgrind.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Apr 20, 2009
1 parent 1f9b620 commit 7183c09
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tree.c
Original file line number Diff line number Diff line change
@@ -62,6 +62,7 @@ static int match_tree_entry(const char *base, int baselen, const char *path, uns
continue;
/* pathspecs match only at the directory boundaries */
if (!matchlen ||
baselen == matchlen ||
base[matchlen] == '/' ||
match[matchlen - 1] == '/')
return 1;

0 comments on commit 7183c09

Please sign in to comment.