@matheusbsbs / matheus-bagliano / commits / 7183c09d11
Fork 0

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>

Johannes Schindelin committed Apr 20, 2009 at 19:44 UTC 7183c09d11ac4b98f1cc78f29dcbd85df5533001
1 file changed +1
tree.c
+1
@@ -62,6 +62,7 @@ static int match_tree_entry(const char *base, int baselen, const char *path, uns
62 continue;
63 /* pathspecs match only at the directory boundaries */
64 if (!matchlen ||
65 + baselen == matchlen ||
66 base[matchlen] == '/' ||
67 match[matchlen - 1] == '/')
68 return 1;