From 0d778b1a892d53161b4392ed75adcb3dcfe1a3df Mon Sep 17 00:00:00 2001 From: "Scott J. Goldman" Date: Sun, 18 Nov 2012 16:52:04 -0800 Subject: [PATCH] Catch invalid filenames in append_entry() This prevents the index api from calling write_tree() with a bogus tree. --- src/tree.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tree.c b/src/tree.c index 150f90c44..6f9838880 100644 --- a/src/tree.c +++ b/src/tree.c @@ -374,6 +374,9 @@ static int append_entry( { git_tree_entry *entry; + if (!valid_entry_name(filename)) + return tree_error("Failed to insert entry. Invalid name for a tree entry"); + entry = alloc_entry(filename); GITERR_CHECK_ALLOC(entry);