Code

fast-import: don't allow 'ls' of path with empty components
[git.git] / fast-import.c
index fff285cd0f73ca2bfe5b76aa3d87a156ad7808ff..47f61f3cba7b7a4cde8ae116cbce38116562bda6 100644 (file)
@@ -1640,6 +1640,8 @@ static int tree_content_get(
                n = slash1 - p;
        else
                n = strlen(p);
+       if (!n)
+               die("Empty path component found in input");
 
        if (!root->tree)
                load_tree(root);