summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2009-04-20 17:44:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-04-20 20:44:14 (GMT)
commit7183c09d11ac4b98f1cc78f29dcbd85df5533001 (patch)
treebc5d434c42ae7f87f2ab628be8cb4a99012352cb
parent1f9b620fdbf27835f54b11008d64c4014b8f4c32 (diff)
downloadgit-7183c09d11ac4b98f1cc78f29dcbd85df5533001.zip
git-7183c09d11ac4b98f1cc78f29dcbd85df5533001.tar.gz
git-7183c09d11ac4b98f1cc78f29dcbd85df5533001.tar.bz2
Fix off-by-one in read_tree_recursive
Found by valgrind. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--tree.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tree.c b/tree.c
index 0d703a0..5ab90af 100644
--- a/tree.c
+++ b/tree.c
@@ -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;