Commits

Anonymous committed 7183c09

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>

  • Participants
  • Parent commits 1f9b620

Comments (0)

Files changed (1)

 				continue;
 			/* pathspecs match only at the directory boundaries */
 			if (!matchlen ||
+			    baselen == matchlen ||
 			    base[matchlen] == '/' ||
 			    match[matchlen - 1] == '/')
 				return 1;